Question:What does the following function do, when passed two integer values for $p and $q?
<?php
function magic($p, $q) {
  return ($q == 0) ? $p : magic($q, $p % $q);
}
?>
 

A Loops infinitely 

B Switches the values of $p and $q 

C Determines if they are both even or odd 

D Determines the greatest common divisor between them 

E Calculates the modulus between the two 

+ Answer
+ Report
Total Preview: 1226

Copyright © 2024. Powered by Intellect Software Ltd