1. Which control structure executes a block of code only if a condition is true?
(A) for loop
(B) if statement
(C) while loop
(D) switch
2. Which keyword is used for an alternative block of code if the if condition is false?
(A) elif
(B) else
(C) otherwise
(D) next
3. Which keyword is used to check multiple conditions in sequence?
(A) switch
(B) else
(C) if
(D) elif
4. Which loop is used when the number of repetitions is known?
(A) while
(B) for
(C) do-while
(D) if-else
5. Which loop is used when the number of repetitions is not known?
(A) for
(B) do-while
(C) while
(D) switch
6. What does the break statement do inside a loop?
(A) Skips the current iteration
(B) Starts a new loop
(C) Continues to the next iteration
(D) Exits the loop immediately
7. What does the continue statement do inside a loop?
(A) Exits the loop immediately
(B) Repeats the same iteration
(C) Stops the program
(D) Skips the current iteration and moves to the next
8. Which control structure is best for checking multiple fixed options?
(A) switch/case
(B) for
(C) if
(D) while
9. Which statement is used to exit a function or method immediately?
(A) stop
(B) break
(C) return
(D) exit
10. Which type of loop executes at least once regardless of the condition?
(A) for
(B) while
(C) if
(D) do-while
11. What happens if the loop condition is always true?
(A) Infinite loop
(B) Loop will stop immediately
(C) Skip iteration
(D) Error occurs
12. Which control structures can be placed inside another control structure?
(A) Both if-else and loops
(B) loops only
(C) if-else only
(D) None
13. Which keyword is used to handle multiple conditions in a single sequence?
(A) case
(B) else
(C) switch
(D) elif
14. Which loop is best when the exact number of repetitions is known beforehand?
(A) while
(B) if-else
(C) do-while
(D) for
15. Which loop repeats a block of code while a condition remains true?
(A) while
(B) for
(C) if
(D) switch
16. Which statement is used to skip the current iteration in a loop?
(A) break
(B) return
(C) continue
(D) pass
17. Which statement does nothing and is used as a placeholder?
(A) pass
(B) continue
(C) break
(D) return
18. What type of control structure is if-else?
(A) Sequential
(B) Iterative
(C) Conditional
(D) Functional
19. Which loop executes code for each item in a fixed collection of elements?
(A) do-while
(B) while
(C) for
(D) if
20. Which control structure allows choosing between multiple options based on a value?
(A) if
(B) switch/case
(C) while
(D) for