Single Choice Moderate

QExtra semicolon after if(cond); makes:

ID: #25943 MCQ Quiz - Class 8 - Decision Control Structure 3 views
Question Info
#25943Q ID
ModerateDifficulty
MCQ Quiz - Class 8 - Decision Control StructureTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Body empty
  • B Body full
  • C Nothing
  • D Error only
Correct Answer

Explanation

Correct Answer Explanation:

if(cond); with a semicolon means the if body is EMPTY. The next statement runs unconditionally, which is a subtle bug.

Why the other options are incorrect:

  • Option B: Body is empty, not full.
  • Option C: It changes program behavior.
  • Option D: No error, but logic is broken — a silent bug.

Share This Question

Challenge a friend or share with your study group.