wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Control Structures - MCQ

Total questions: 8

Worksheet time: 4mins

Name
Class
Date
1.

Aarav is planning a picnic, and he has set a condition that if it is sunny, they will go to the park. However, if it is not sunny but the weather is pleasant, they will go to the beach. Which term describes the additional conditional block that runs when the earlier condition (sunny) is false and its expression (pleasant weather) is true?

a)

elseif

b)

if

c)

while

d)

continue

2.

During a coding competition, Aarav is working on a project that involves nested loops. He realizes that he needs to exit the innermost loop or switch statement prematurely to optimize his code. Which statement should he use to achieve this?

a)

break

b)

continue

c)

case

d)

elseif

3.

Aanya is organizing a charity event and needs to keep the event running as long as there are guests arriving. Which looping construct would she use to repeat the event activities while guests are still coming in?

a)

while

b)

for

c)

continue

d)

if

4.

Imagine a restaurant where a chef decides which dish to prepare based on the customer's order. Which control structure selects among multiple blocks based on the value of the customer's choice?

a)

switch

b)

case

c)

for

d)

break

5.

In a programming class, Arnav is learning about control structures. His instructor explains that when using a switch construct, a specific value is needed to determine which block of code to execute. What is the term used to label that specific value?

a)

case

b)

switch

c)

continue

d)

if

6.

Vanya is planning a surprise party for Aanya. She has a list of conditions to decide if she should proceed with the party preparations. Which term describes the conditional control structure that executes a block when an expression is true?

a)

if

b)

elseif

c)

switch

d)

case

7.

Aarav is organizing a community clean-up event where he needs to pick up litter in a park. He decides to repeat the task of picking up litter a set number of times to ensure the park is clean. Which looping construct would he use to repeat this block of work?

a)

for

b)

while

c)

switch

d)

break

8.

During a cooking competition, Avyaan is preparing a dish and needs to skip certain steps if he realizes they won't work. Which statement should he use to skip to the next step of the recipe?

a)

continue

b)

break

c)

switch

d)

for