PHP Conditional Statements One Mark Question

12th Standard EM

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Applications

Time : 00:30:00 Hrs
Total Marks : 10
    6 x 1 = 6
  1. What will be the output of the following PHP code?
    < ? php
    \($\) x;
    if (\($\)x)
    print “hi” ;
    else
    print “how are u”;
    ? >

    (a)

    how are u

    (b)

    hi

    (c)

    error

    (d)

    no output

  2. What will be the output of the following PHP code ?
    < ?php
    \($\) x = 0;
    if (\($\)x++)
    print “hi”;
    else
    print “how are u”;
    ? >

    (a)

    hi

    (b)

    no output

    (c)

    error

    (d)

    how are u

  3. Statement which is used to make choice between two options and only option is to be performed is written as

    (a)

    if statement

    (b)

    if else statement

    (c)

    then else statement

    (d)

    else one statement

  4. What will be the output of the following PHP code ?
    < ?php
    \($\)a = “”;
    if (\($\)a)
    print “all”;
    if
    else
    print “some”;
    ? >

    (a)

    all

    (b)

    some

    (c)

    error

    (d)

    no output

  5. What will be the output of the following PHP code ?
    < ?php
    \($\)x = 10;
    \($\)y = 20;
    if (\($\)x > \($\)y + \($\)y != 3)
    print “hi” ;
    else
    print “how are u”;
    ? >

    (a)

    how are u

    (b)

    hi

    (c)

    error

    (d)

    no output

  6. What will be the output of the following PHP code ?
    < ?php
    if (-100)
    print “hi” ;
    else
    print “how are u”;
    ? >

    (a)

    how are u

    (b)

    hi

    (c)

    error

    (d)

    no output

  7. 4 x 1 = 4
  8. Simple if statements

  9. (1)

    Only one option

  10. If-else statement

  11. (2)

    Multiple branching

  12. If elseif else statement

  13. (3)

    Alternative statement

  14. Switch case statement

  15. (4)

    Combination of if-else statement

*****************************************

TN 12th Standard EM Computer Applications free Online practice tests

Reviews & Comments about 12th Standard Computer Application Unit 6 PHP Conditional Statements One Mark Question and Answer

Write your Comment