Single Choice Moderate

QCorrect syntax is:

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

Choose the Best Option

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

  • A if(cond){...} else {...}
  • B if cond then else
  • C elseif cond
  • D None
Correct Answer

Explanation

Correct Answer Explanation:

Java syntax uses parentheses for the condition and curly braces for both if and else blocks.

Why the other options are incorrect:

  • Option B: 'then' isn't Java syntax; use braces.
  • Option C: Java uses 'else if' (with space), not 'elseif'.
  • Option D: There is a correct syntax.

Share This Question

Challenge a friend or share with your study group.