-
What will be the output of the following PHP code ?
<?php
function Res($p,$q)
{
$p = 7;
$q = 8;
$r = $p + $q / $q + $p;
echo "$r";
}
Res(8, 7);
?>
-
- 7
- 8
- 15
- Error
- None of these
Correct Option: C
Value 8, 7 is passed to the function but that is lost because p and q are initialised to 7 and 8 inside the function. Therefore we get the given result.