Home » PHP » PHP If Else/Else If Statement » Question
  1. What will be the output of the following PHP code ?
    <?php
    $p = 150;
    if ($p > 25)
    printf("Ajit");
    else if ($p > 35)
    printf("Ats");
    else if($p > 45)
    printf("Aju");
    ?>
    1. Ajit
    2. Ats
    3. Aju
    4. All of above
    5. None of these
Correct Option: A

In if else if one condition is satisfied then no other condition is checked.



Your comments will be displayed only after manual approval.