wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CC113B-LoopStatementsQuiz-BSCS1A

Total questions: 14

Worksheet time: 17mins

Name
Class
Date
1.

Type TRUE if the statement is correct. Type FALSE if the statement is NOT correct.


Looping statements have one control condition and executes as long as the condition is true.

(a)  

2.

Type TRUE if the statement is correct. Type FALSE if the statement is NOT correct.


In an entry-controlled loop, the condition of the loop is tested before the body of the loop is executed.

(a)  

3.

Type TRUE if the statement is correct. Type FALSE if the statement is NOT correct.


"do while" statements are entry-controlled loop.

(a)  

4.

Type TRUE if the statement is correct. Type FALSE if the statement is NOT correct.


"for" statements are exit-controlled loop.

(a)  

5.

Type TRUE if the statement is correct. Type FALSE if the statement is NOT correct.


"while" statements are entry-controlled loop.

(a)  

6.

In a "for" statement, this is the part of the code that sets the first value of the variable before the loop starts.

(a)  

7.

In a loop statement, this part is always tested for every loop.

(a)  

8.

Which of the following has the correct syntax for a "while" statement?

a)

While (condition); { statement(s); increment or decrement; }

b)

While (condition) { statement(s); increment or decrement; }

c)

while (condition) { statement(s); increment or decrement; }

d)

while (condition); { statement(s); increment or decrement; }

9.

Which of the following has the correct syntax for a "do while" statement?

a)

do { statement(s); increment or decrement; } while(condition);

b)

do { statement(s); increment or decrement; } while(condition)

c)

do while(condition); { statement(s); increment or decrement; }

d)

do while(condition) { statement(s); increment or decrement; }

10.

Which of the following has the correct syntax for a "for" statement?

a)

for(x<=1; x=10; x++)

b)

for(x=1; x>10; x++)

c)

for(x=1; x=10; x++)

d)

for(x=1; x>10; x++);

11.

Analyze the code and select what would be its output. (5points)

a)

2 4 6 8 10

b)

2 4 6 8

c)

2 3 4 5 6 7 8 9 10

12.

Analyze the code and select what would be its output.(5points)

a)

ABC ABC ABC ABC

b)

ABC ABC ABC ABC ABC

c)

ABC ABC ABC

13.

Analyze the code and select what would be its output.(5points)

a)

ABC ABC ABC ABC

b)

ABC ABC ABC

c)

The program will not run.

14.

Analyze the code and select what would be its output.(5points)

a)

ABC ABC ABC ABC

b)

ABC ABC ABC

c)

The program will not run.