Examveda

In C++, what is the difference between the 'while' loop and the 'do-while' loop?

A. 'while' loop always executes at least once, 'do-while' loop may not

B. 'while' loop always executes at least once, 'do-while' loop always does

C. 'while' loop checks condition before execution, 'do-while' loop checks after execution

D. None of the above

Answer: Option C


Join The Discussion

Related Questions on Control Flow Statements in C plus plus

What is the correct syntax for the 'switch' statement in C++?

A. switch (expression) { case constant1: statement1; case constant2: statement2; }

B. switch (expression) { case constant1: statement1; break; case constant2: statement2; break; default: defaultStatement; }

C. switch (expression) { case constant1: statement1; default: defaultStatement; }

D. None of the above