Important MCQ

Which is the correct do-while syntax?

Q.Which is the correct do-while syntax?

A) do { } while (x > 0)
B) do {} while (x > 0);
C) do () while {x > 0};
D) do while (x > 0) { };
Correct Answer:
Option B
Detailed Explanation:
Semicolon after the condition is mandatory.