T4Tutorials .PK

NSCT – Control Structures MCQs

1. Which control structure executes a block of code only if a condition is true?

(A) for loop


(B) while loop


(C) if statement


(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) elif


(B) else


(C) if


(D) switch




4. Which loop is used when the number of repetitions is known?

(A) while


(B) do-while


(C) for


(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) Exits the loop immediately


(C) Continues to the next iteration


(D) Starts a new loop




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) return


(B) break


(C) stop


(D) exit




10. Which type of loop executes at least once regardless of the condition?

(A) for


(B) while


(C) do-while


(D) if




11. What happens if the loop condition is always true?

(A) Loop will stop immediately


(B) Skip iteration


(C) Infinite loop


(D) Error occurs




12. Which control structures can be placed inside another control structure?

(A) if-else only


(B) Both if-else and loops


(C) loops only


(D) None




13. Which keyword is used to handle multiple conditions in a single sequence?

(A) else


(B) elif


(C) switch


(D) case




14. Which loop is best when the exact number of repetitions is known beforehand?

(A) while


(B) for


(C) do-while


(D) if-else




15. Which loop repeats a block of code while a condition remains true?

(A) if


(B) for


(C) switch


(D) while




16. Which statement is used to skip the current iteration in a loop?

(A) continue


(B) break


(C) return


(D) pass




17. Which statement does nothing and is used as a placeholder?

(A) return


(B) continue


(C) break


(D) pass




18. What type of control structure is if-else?

(A) Sequential


(B) Functional


(C) Iterative


(D) Conditional




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) for


(C) while


(D) switch/case




Exit mobile version