Vidyalelo
C++ Programming · all questions

Control Flow Statements in C++
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

47

Questions

3/3

Page

Pick an option on a question to see the right answer and solution.

In C++, what is the syntax for the 'while' loop?

Select an option to see the answer and solution.

What will be the output of the following code: int i = 5; if (i != 5) cout << "Not equal"; else cout << "Equal"; in C++?

Select an option to see the answer and solution.

What is the output of the following code: int i = 0; while (i < 5) { cout << i << " "; ++i; } in C++?

Select an option to see the answer and solution.

How many times will the following 'for' loop iterate: for (int i = 0; i < 5; ++i) in C++?

Select an option to see the answer and solution.

In C++, what is the purpose of the 'continue' statement in a loop?

Select an option to see the answer and solution.

What will be the output of the following code: int i = 0; while (i < 3) { cout << ++i << " "; } in C++?

Select an option to see the answer and solution.

What will be the output of the following code: int x = 10; if (x < 5) cout << "Less"; else if (x == 5) cout << "Equal"; else cout << "More"; in C++?

Select an option to see the answer and solution.