Flow Control Questions and Answers
Practice ModeShowing 10 of 29 questions
Q21
What happens if the loop condition is always true?
Answer: Option B
Explanation: A true condition means loop never ends.
Q22
Which operator is used for NOT condition?
Answer: Option C
Explanation: ! reverses boolean values.
Q23
Which control statement chooses one block among many?
Answer: Option B
Explanation: if-else-if supports multi-branching.
Q24
In a for-loop, what part is optional?
Answer: Option D
Explanation: Java allows all 3 sections optional in a for loop.
Q25
What will happen if break is missing in a switch case?
Answer: Option C
Explanation: Without break, cases fall-through sequentially.
Q26
Which loop is preferred when condition checking is needed before entering loop?
Answer: Option B
Explanation: while checks the condition first.
Q27
Which keyword handles multiple fixed value matching?
Answer: Option A
Explanation: switch compares expressions to multiple cases.
Q28
What type of loop is this? for(;;)
Answer: Option B
Explanation: All sections empty = infinite loop.
Q29
Which statement is used to transfer program control based on expression value?
Answer: Option B
Explanation: switch allows control flow based on value matching.