NEW
Font size
WorksheetsCondition Programming Quiz
Total questions: 9
Worksheet time: 5mins
What is a control structure?
A type of data structure
An element that determines which block of statements to execute
A type of loop
A programming language
What does the 'if' statement do?
It always executes the block of code
It executes the block of code only if the condition is true
It repeats a block of code
It defines a variable
What does 'else' do in an if-else statement?
Executes if the first condition is false
Executes if the first condition is true
Defines a new condition
Always executes
What is the purpose of 'else if'?
To repeat a block of code
To end a program
To define a variable
To check multiple conditions
What will be the output if 'a = 9' and 'if(a < 9)'?
Hello 2
Nothing happens
Condition return false
Condition return true
What does 'nested condition' mean?
A type of loop
Conditions inside another condition
A variable definition
An error in code
What is the first step in a decision-making process?
End the program
Write the output
Check the condition
Define the variables
What is the output of 'if(x < 0) then write("It is a negative number.")' when x is -5?
It is zero.
It is a positive number.
It is a negative number.
Nothing happens
What will happen if the condition in an 'if' statement is false?
The block of code will execute
Nothing will happen
An error will occur
The program will end
