Home » PHP » PHP Variables » Question
  1. What will be the output of the following PHP code ?
    <?php
    $p = 12;
    $q = 21;
    $r = 13;
    echo $p + $q - $r / ($r - $q);
    ?>
    1. 12
    2. 34
    3. 21
    4. 13
    5. 34.625
Correct Option: E

First ($r – $q) is evaluated then -$r/($r – $q) is evaluated this which is added to $p + $q therefore we get 34.625.



Your comments will be displayed only after manual approval.