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

Code:
<?php
$num1 = 25;
$num2 = 27;
if ($num1 > $num2 && 1||1)
    print "Jitendra" ;
else
    print "Majumdar";
?>
  • (A) Majumdar
  • (B) 25
  • (C) Jitendra
  • (D) 27
πŸ’¬ Discuss
βœ… Correct Answer: (C) Jitendra

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

Code:
<?php
$n1 = 17;
$n2 = 19;
if ($n1 > $n2 + $n2 != 3)
    print "Jitendra" ;
else
    print "Majumdar";
?>
  • (A) Majumdar
  • (B) Jitendra
  • (C) 17
  • (D) 19
πŸ’¬ Discuss
βœ… Correct Answer: (B) Jitendra

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

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

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

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

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

Code:
<?php
$num = 5;
if (5) 
    print "First";
 if 
 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 "Program ")
    print "Executed..." ;
else
    print "Not Executed...";
?>
  • (A) Program
  • (B) Executed...
  • (C) Not Executed...
  • (D) Program Executed...
πŸ’¬ Discuss
βœ… Correct Answer: (D) Program Executed...

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

Code:
<?php
$p = 50;
$q = 60;
if ($p > $q && 1||1)
    print "Executed...." ;
else
    print "Not Executed....";
?>
  • (A) Not Executed....
  • (B) True
  • (C) Executed....
  • (D) False
πŸ’¬ Discuss
βœ… Correct Answer: (C) Executed....

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

Code:
<?php
if (-200)
    print "Majumdar" ;
else
    print "Jitendra";
?>
  • (A) 0
  • (B) 1
  • (C) -200
  • (D) Jitendra
πŸ’¬ Discuss
βœ… Correct Answer: (D) Jitendra

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

Code:
<?php
if (0.25)
    print "Jitendra" ;
else
    print "Majumdar";
?>
  • (A) Error
  • (B) Jitendra
  • (C) Majumdar
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (B) Jitendra

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

Code:
<?php
if (0.0)
    print "First" ;
else
    print "Second";
?>
  • (A) True
  • (B) First
  • (C) False
  • (D) Second
πŸ’¬ Discuss
βœ… Correct Answer: (D) Second