Home » PHP » PHP Variables » Question
  1. What will be the output of the following PHP code ?
    <?php
    $p = 6;
    $q = 5;
    function Res($p , $q )
    {
    $r = $p+$q/$q+$p;
    echo "$r";
    }
    echo $p;
    echo $q;
    echo $r;
    Res(5, 6);
    ?>
    1. 6511
    2. 611
    3. Nothing
    4. Error
    5. None of these
Correct Option: A

It is same as above but the value passed into the function is 5,6 and not 6,5. Therefore the difference in answer.



Your comments will be displayed only after manual approval.