"> What will be the output of the following PHP code ?<?php$n

Home » PHP » PHP Operators » Question
  1. What will be the output of the following PHP code ?
    <?php
    $n = 5;
    if ($n++ && ($n == 5))
    echo "Yes\n$n";
    else
    echo "No\n$n";
    ?>
    1. Yes
    2. No
    3. No
      6
    4. Yes
      6
    5. None of these
Correct Option: C

The first condition returns true and increments but the second condition is false.



Your comments will be displayed only after manual approval.