wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CA Chapter 7 Loop

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which is used to work with array?

a)

For loop

b)

For each loop

c)

while

d)

do while

2.

Loops that iterate for fixed number of times is called

a)

unbounded loop

b)

bounded loop

c)

while loop

d)

for loop

3.

Which loop evaluates condition expression as Boolean, if it is true, it executes statements and when it is false it will terminate?

a)

For loop

b)

For each loop

c)

While loop

d)

All of these

4.

for ($ x=0; $ x<5; x++)

echo “Hai”

The above loop executes how many no of times?

a)

5

b)

4

c)

3

d)

2

5.

What will be displayed in a browser when the above PHP code is executed?

a)

Welcome to Tamilnadu

b)

Counter is: 20

c)

Welcome to Tamilnadu Counter is: 22

d)

Welcome to Tamilnadu Welcome to Tamilnadu Counter is: 22

6.

What will be displayed in a browser when the following PHP code is executed?

a)

Hello Hello Hello Hello Hello

b)

Hello Hello Hello

c)

None of the above

d)

Hello

7.

PHP supports which types of looping techniques;

a)

for

b)

while

c)

do while

d)

all of these

8.

What will be the output of the code?

a)

12 squared 141

b)

“12 squared=144”

c)

12 squared=144

d)

Execution error

9.

What will be the output of the following PHP code ?

a)

**********

b)

*********

c)

***********

d)

Error

10.

What will be the output of the following PHP code ?

a)

123456713910412

b)

123456713910

c)

1234567139104

d)

Infinite loop