Question 1 of 25
Hints left: 3
Q1
What is the purpose of the 'break' statement in a loop in C++?
Q2
What is the syntax for the 'if-else' statement in C++?
Q3
What is the syntax for the 'for' loop in C++?
Q4
What will be the output of the following code: int i = 0; while (i < 3) { cout << i << " "; i++; } in C++?
Q5
In C++, what is the purpose of the 'do-while' loop?
Q6
What is the purpose of the 'if-else if-else' statement in C++?
Q7
What is the purpose of the 'default' case in a 'switch' statement in C++?
Q8
What will be the output of the following code: int i = 0; while (i < 5) { cout << i << " "; i++; } in C++?
Q9
What will be the output of the following code: for (int i = 0; i < 3; ++i) { for (int j = 0; j < 2; ++j) { cout << i << j << " "; } }?
Q10
What will be the output of the following code: int x = 5; x > 2 ? cout << "Yes" : cout << "No"; in C++?
Q11
What does the 'else if' statement allow in C++?
Q12
What is the syntax for the 'do-while' loop in C++?
Q13
What will be the output of the following code: for (int i = 5; i >= 0; --i) { cout << i << " "; if (i == 3) break; } in C++?
Q14
What will be the output of the following code: int x = 10; if (x > 5) cout << "Hello"; else cout << "Goodbye"; in C++?
Q15
What does the 'do' keyword represent in the 'do-while' loop syntax in C++?
Q16
What is the correct syntax for the 'while' loop in C++?
Q17
What does the 'break' statement do in a loop in C++?
Q18
What is the output of the following code: for (int i = 0; i < 3; ++i) { for (int j = 0; j < 2; ++j) { cout << i << j << " "; } } in C++?
Q19
What will be the output of the following code: for (int i = 0; i < 5; ++i) { if (i == 2) continue; cout << i << " "; } in C++?
Q20
What is the output of the following code: int x = 10; if (x == 10) { cout << "x is 10"; } else { cout << "x is not 10"; } in C++?
Q21
What is the syntax for the 'if' statement with multiple conditions in C++?
Q22
In C++, what is the difference between the 'while' loop and the 'do-while' loop?
Q23
What is the output of the following code: int x = 5; switch (x) { case 1: cout << "One"; break; case 5: cout << "Five"; break; } in C++?
Q24
What is the purpose of the 'continue' statement in a loop in C++?
Q25
What will be the output of the following code: for (int i = 0; i < 5; ++i) { if (i == 3) continue; cout << i << " "; } in C++?