Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Conditionals and Loops

Total questions: 9

Worksheet time: 5mins

Name
Class
Date
1.

What will be the output of the following program?

a)

All even numbers until 10 will be displayed

b)

All odd numbers until 10 will be displayed

2.

In the following program which loop is used?

a)

For loop

b)

Recursion

c)

For/In loop

d)

While loop

3.

In the following program which loop is used?

a)

For loop

b)

Recursion

c)

For/In loop

d)

While loop

4.

In the following program which loop is used?

a)

For loop

b)

Recursion

c)

For/In loop

d)

While loop

5.

According the following program state the output

a)

You have enough money to purchase the item!

b)

You do not have enough money in your account to purchase this item.

6.

Accordingly to the following program state the output

a)

Grade A

b)

Grade B

c)

Grade C

d)

Grade D

e)

Failed

7.

Which type of conditional statement is this?

a)

If Statement

b)

If...else Statement

c)

Nested If Statement

d)

If... Else If Statement

8.

According to the following program what will be the output?

a)

You are Eligible to Work.

b)

You are not Eligible to Work as per the Government rules.

9.

According to the following program what will happen if the user enters the incorrect password the 5th time?

a)

Login Successful!

b)

Incorrect password... Try again!

c)

3 unsuccessful attempts...The system is blocked!

d)

The user cannot enter the password the 5th time as the loop will stop after 3rd unsuccessful event.