New ! Computer Applications MCQ Practise Tests



PHP Conditional Statements 1 Mark Creative Question Paper With Answer Key

12th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Applications

Time : 00:20:00 Hrs
Total Marks : 15

    Multiple Choice Question 

    15 x 1 = 15
  1. What will be the output of the following PHP code?
    < ?php
    if(0.1)
    print''hi'';
    else
    print''how are u";
    ? >

    (a)

    hi

    (b)

    error

    (c)

    no output

    (d)

    how are u

  2. What will be the output of the following PHP code?
    < ?php
    if(0.0)
    print''hi'';
    else
    print''how are u";
    ? >

    (a)

    how are u

    (b)

    hi

    (c)

    error

    (d)

    no output

  3. What will be the output of the following PHP code?
    < ?php
    $x= 1;
    if($x==2)
    print''hi'';
    elseif($x=2)
    print $x;
    else
    print''how are u";
    ? >

    (a)

    error

    (b)

    2

    (c)

    hi

    (d)

    how are u

  4. What will be the output of the following PHP code?
    < ?php
    $a="1";
    switch($a)
    {
    case 1 :
    break;
    print''hi'';
    case 2:
    print''hello'';
    break;
    default:
    print''hi1'';
    }
    ? >

    (a)

    hihellohi1

    (b)

    hi

    (c)

    hihi1

    (d)

    hi1

  5. Conditional statements are useful for writing ______  making logics.

    (a)

    style

    (b)

    output

    (c)

    decision

    (d)

    business

  6. Conditional statements are the most important feature of many ____ lauguages.

    (a)

    script

    (b)

    programming

    (c)

    static

    (d)

    dynamic

  7. How many types of PHP conditional statements are there?

    (a)

    2

    (b)

    3

    (c)

    4

    (d)

    6

  8. Which of the following statement is not related to PHP condition?

    (a)

    if

    (b)

    if ... else

    (c)

    switch

    (d)

    do ... while

  9. Conditional statements are very often when we write code and to perform different actions for different ____ in different business logic.

    (a)

    making

    (b)

    style

    (c)

    output

    (d)

    decisions

  10. If ... else if ... else statement is a combination of ____ statement?

    (a)

    if ... else

    (b)

    else if

    (c)

    if ... else if

    (d)

    else ... if else

  11. In which of the following statement, more than one statement can execute the condition, based or user needs?

    (a)

    if ... else if

    (b)

    if ... else if ... else

    (c)

    if ... else if ... if

    (d)

    else ... if else ... if

  12. else executes the block of statements if the Condition in the corresponding if is _____.

    (a)

    executed

    (b)

    checked

    (c)

    true

    (d)

    false

  13. Which of the following statement is used to perform different action based on different conditions?

    (a)

    GO TO

    (b)

    if ... else ... if

    (c)

    if ... else ladder

    (d)

    Switch case

  14. Which of the following statement contains boolean expression inside brackets followed by a single or multiline code block?

    (a)

    switch case

    (b)

    if ... else

    (c)

    if ... else if

    (d)

    if

  15. ____ statement also provides for a second part to the if statement, (ie) else.

    (a)

    if

    (b)

    if-else

    (c)

    else if

    (d)

    if ... else if

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

Reviews & Comments about 12th Standard Computer Applications English Medium - PHP Conditional Statements 1 Mark Creative Question Paper and Answer Key 2022 - 2023

Write your Comment