New ! Computer Applications MCQ Practise Tests



PHP Conditional Statements Publishing Model Question Paper 1

12th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Applications

Time : 01:00:00 Hrs
Total Marks : 50
    5 x 1 = 5
  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;
    if (\($\)x == 0)
    print “hi” ;
    else
    print “how are u”;
    print “hello”
    ? >

    (a)

    how are uhello

    (b)

    hihello

    (c)

    hi

    (d)

    no output

  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”;
    else
    print “some”;
    ? >

    (a)

    all

    (b)

    some

    (c)

    error

    (d)

    no output

  5. 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

  6. 5 x 2 = 10
  7. What are the different types of conditional statements in PHP?

  8. Write the syntax for an if statement in PHP.

  9. What is the purpose of the if ... else statement?

  10. Write the Syntax of Switch statement.

  11. Compare if and if else statement.

  12. 5 x 3 = 15
  13. Write the features Conditional Statements in PHP.

  14. Differentiate Switch and if else statement.

  15. Differentiate if statement and if elseif else statement.

  16. Write a php program to check whether the given number is positive or negative.

  17. Write, a PHP program to display independenc day and republic day the greetings using If elseif else statement.

  18. 4 x 5 = 20
  19. Explain the if elseif else statement. With suitable example.

  20. Explain if else statement in PHP. With an example.

  21. Write a PHP code to display the days of weak using switch statement

  22. Write a PHP program to display week days using switch case statement.

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

Reviews & Comments about 12th Computer Applications - PHP Conditional Statements Publishing Model Question Paper 1

Write your Comment