NEW
Font size
WorksheetsLA4.C4: Conditions and Loops
Total questions: 14
Worksheet time: 7mins
What will the program output if the current hour is 10?
Good Morning World
Good Evening World
Good Night World
Hello World
Which keyword is used to start a conditional statement in the program?
EndIf
Else
If
Then
What does the Math.Remainder function do?
Multiplies two numbers
Divides one number by another and returns the remainder
Subtracts one number from another
Adds two numbers
What is the purpose of the Else statement in the program?
To end the program
To provide an alternative action if the condition is false
To define a new variable
To repeat the condition
How can you increment a variable by 2 in a For loop?
For i = 1 To 24 Increase 2
For i = 1 To 24 Add 2
For i = 1 To 24 Increment 2
For i = 1 To 24 Step 2
What will the While loop do in the provided example?
Run for a fixed number of times
Run until the number is greater than 1
Run until the number is less than or equal to 1
Run indefinitely
What is the output of the program if the input number is 7?
The number is Composite
The number is Prime
The number is Odd
The number is Even
What does indentation in programming help with?
It is required for the program to work
It helps in understanding the structure of the program
It makes the program run faster
It adds comments to the code
What is the purpose of the EndIf statement?
To define a loop
To declare a variable
To end a conditional execution
To start a new condition
Which of the following is a valid For loop syntax?
For i = 1 To 24 Step 1
For i = 1 To 24
For i = 1 To 24 EndFor
For i = 1 To 24 Increment 1
What will the output be if the current hour is 12?
Good Morning World
Good Night World
Good Evening World
Good Afternoon World
What is the initial value of 'i' in the For loop example?
0
24
1
10
What does the Step keyword do in a For loop?
Defines the end of the loop
Specifies the increment value
Starts a new loop
Ends the program
What is the output of the program when counting backwards from 10?
10, 9, 8, 7, 6, 5, 4, 3, 2
10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
10, 9, 8, 7, 6, 5, 4, 3, 2, 1
