Question 1: C++ If Statement
Which of the following is the correct syntax of an if statement in C++?
Question 2: C++ Guess the Output – Simple If
What will be the output of the following C++ code snippet?
Question 3: C++ If-Else Statement
Which keyword is used in C++ to specify an alternative block of code if the if condition is false?
Question 4: C++ Guess the Output – If-Else
What will be the output of the following C++ code snippet?
Question 5: C++ Else-If Ladder
Which statement is true about an else-if ladder in C++?
Question 6: C++ Guess the Output – Else If Ladder
What will be the output of the following C++ code snippet?
Question 7: C++ Switch Statement
Which of the following is NOT true about the switch statement in C++?
Question 8: C++ Guess the Output – Switch Case
What will be the output of the following C++ code snippet?
Question 9: C++ Nested If
What is the output of the following C++ code snippet?
Question 10: C++ Ternary Operator as If-Else
Which of the following C++ statements correctly uses the ternary operator to check if a number n is even or odd?