" /> -->

#### PHP Conditional Statements Book Back Questions

12th Standard EM

Reg.No. :
•
•
•
•
•
•

Computer Applications

Time : 00:45:00 Hrs
Total Marks : 30
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. 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

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

4. What will be the output of the following PHP code ?
< ?php
x = 10;
y = 20;
if (x > y && 1||1)
print “hi” ;
else
print “how are u”;
? >

(a)

how are u

(b)

hi

(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. 3 x 2 = 6
7. Define Conditional Statements in PHP

8. What is if else statement in PHP?

9. Write Syntax of the If else statement in PHP.

10. 3 x 3 = 9
11. Write the features Conditional Statements in PHP.

12. Write Short notes on Switch statement

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

14. 2 x 5 = 10
15. Explain Function Conditional Statements in PHP.

16. Explain the process Conditional Statements in PHP?