Home / CSE / PHP - CS :: Control Structures(Loop in PHP)

CSE :: PHP - CS

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

    <?php

    $x;

    if ($x)

    print "hi" ;

    else

    print "how are u";

    ?>

  2. A.

     how are u

    B.

     hi

    C.

     error

    D.

     no output

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $x = 0;

    if ($x++)

    print "hi";

    else

    print "how are u";

    ?>

  4. A.

     hi

    B.

     no output

    C.

     error

    D.

     how are u

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $x;

    if ($x == 0)

    print "hi" ;

    else

    print "how are u";

    print "hello"

    ?>

  6. A.

     how are uhello

    B.

     hihello

    C.

     hi

    D.

     no output

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $x = 0;

    if ($x == 1)

    if ($x >= 0)

    print "true";

    else

    print "false";

    ?>

  8. A.

     true

    B.

     false

    C.

     error

    D.

     no output

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $a = 1;

    if ($a--)

    print "True";

    if ($a++)

    print "False";

    ?>

  10. A.

     true

    B.

     false

    C.

     error

    D.

     no output

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $x;

    if ($x)

    print "hi" ;

    else

    print "how are u";

    ?>

  12. A.

     how are u

    B.

     hi

    C.

     error

    D.

     no output

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $x = 0;

    if ($x++)

    print "hi";

    else

    print "how are u";

    ?>

  14. A.

     hi

    B.

     no output

    C.

     error

    D.

     how are u

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $x;

    if ($x == 0)

    print "hi" ;

    else

    print "how are u";

    print "hello"

    ?>

  16. A.

     how are uhello

    B.

     hihello

    C.

     hi

    D.

     no output

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $x = 0;

    if ($x == 1)

    if ($x >= 0)

    print "true";

    else

    print "false";

    ?>

  18. A.

     true

    B.

     false

    C.

     error

    D.

     no output

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    <?php

    $a = 1;

    if ($a--)

    print "True";

    if ($a++)

    print "False";

    ?>

  20. A.

     true

    B.

     false

    C.

     error

    D.

     no output

    View Answer

    Workspace

    Discuss Discuss in Forum