Q. What will be the output of the following PHP code ?

Code:
<?php
$p = 150;
if ($p > 25)
    printf("Jitendra");
else if ($p > 35)
    printf("Jitu");
else if($p > 45)
    printf("Jeetu");
?>
  • (A) Jitendra
  • (B) Jitu
  • (C) Jeetu
  • (D) All of above
πŸ’¬ Discuss
βœ… Correct Answer: (A) Jitendra

Q. What will be the output of the following PHP code ?

Code:
<?php
$t = 11;
if ($t = $t&0)
    print $t;
else
    break;
?>
  • (A) True
  • (B) False
  • (C) 11
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Error

Q. What will be the output of the following PHP code ?

Code:
<?php
$p = 20;
if ($p = $p&0)
    print $p ;
else
    print "Executed...";
?>
  • (A) Error
  • (B) Nothing
  • (C) Executed...
  • (D) 20
πŸ’¬ Discuss
βœ… Correct Answer: (C) Executed...

Q. What will be the output of the following PHP code ?

Code:
<?php
$num = 5;
if ($num = $num&0)
    print $num ;
else
    print "Else statement executed...";
?>
  • (A) True
  • (B) Error
  • (C) 5
  • (D) Else statement executed...
πŸ’¬ Discuss
βœ… Correct Answer: (D) Else statement executed...

Q. What will be the output of the following PHP code ?

Code:
<?php
$num = 5;
if ($num == 6)
    print "Jeetu" ;
else if($num = 6)
    print $num;
else
    print "Majumdar";
?>
  • (A) 6
  • (B) 5
  • (C) Jeetu
  • (D) Majumdar
πŸ’¬ Discuss
βœ… Correct Answer: (A) 6

Q. What will be the output of the following PHP code ?

Code:
<?php
$p = 25;
$q = 26;
if ($p < ++$p || $q < ++$q)
    print "if statement executed...";
else
    print "else statement executed...";
?>
  • (A) else statement executed...
  • (B) Error
  • (C) if statement executed...
  • (D) Nothing
πŸ’¬ Discuss
βœ… Correct Answer: (A) else statement executed...

Q. What will be the output of the following PHP code ?

Code:
<?php
$num = 1;
if ($num--)
    print "First"
    $num--;
else
    print "Second"
?>
  • (A) Nothing
  • (B) Error
  • (C) First
  • (D) Second
πŸ’¬ Discuss
βœ… Correct Answer: (B) Error

Q. What will be the output of the following PHP code ?

Code:
<?php
if (print "Ninth" - 9)
    print "Tenth"
?>
  • (A) Ninth
  • (B) Tenth
  • (C) -9Ninth
  • (D) -9Tenth
πŸ’¬ Discuss
βœ… Correct Answer: (D) -9Tenth

Q. What will be the output of the following PHP code ?

Code:
<?php
if (!print "First")
    if (print "Second")
print "Third";
?>
  • (A) Error
  • (B) Nothing
  • (C) First
  • (D) Second
πŸ’¬ Discuss
βœ… Correct Answer: (C) First

Q. What will be the output of the following PHP code ?

Code:
<?php
$p = 25;
$q = 50;
$r = 15;
if ($p / $q / $r)
    print "Jitendra";
else
    print "Majumdar";
?>
  • (A) true
  • (B) false
  • (C) Jitendra
  • (D) Majumdar
πŸ’¬ Discuss
βœ… Correct Answer: (C) Jitendra