wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Condition Programming Quiz

Total questions: 9

Worksheet time: 5mins

Name
Class
Date
1.

What is a control structure?

a)

A type of data structure

b)

An element that determines which block of statements to execute

c)

A type of loop

d)

A programming language

2.

What does the 'if' statement do?

a)

It always executes the block of code

b)

It executes the block of code only if the condition is true

c)

It repeats a block of code

d)

It defines a variable

3.

What does 'else' do in an if-else statement?

a)

Executes if the first condition is false

b)

Executes if the first condition is true

c)

Defines a new condition

d)

Always executes

4.

What is the purpose of 'else if'?

a)

To repeat a block of code

b)

To end a program

c)

To define a variable

d)

To check multiple conditions

5.

What will be the output if 'a = 9' and 'if(a < 9)'?

a)

Hello 2

b)

Nothing happens

c)

Condition return false

d)

Condition return true

6.

What does 'nested condition' mean?

a)

A type of loop

b)

Conditions inside another condition

c)

A variable definition

d)

An error in code

7.

What is the first step in a decision-making process?

a)

End the program

b)

Write the output

c)

Check the condition

d)

Define the variables

8.

What is the output of 'if(x < 0) then write("It is a negative number.")' when x is -5?

a)

It is zero.

b)

It is a positive number.

c)

It is a negative number.

d)

Nothing happens

9.

What will happen if the condition in an 'if' statement is false?

a)

The block of code will execute

b)

Nothing will happen

c)

An error will occur

d)

The program will end