--:--









Quiz for Decision making if, if-else, switch

Course: C++ Language | Subject: Unit 2 | Topic: Control Structures



Logo

Q1: Which statement is used to make a decision in C++?

Logo

Q2: What is the output of if(0) { cout << "True"; } else { cout << "False"; }

Logo

Q3: Which keyword is used for multiple conditional branches?

Logo

Q4: In a switch statement, what type must the controlling expression be?

Logo

Q5: Which statement exits a switch case?

Logo

Q6: What will happen if break is omitted in a switch case?

Logo

Q7: Which operator is used in if-else for condition checking?

Logo

Q8: How do you write an if statement to check if variable x is greater than 0?

Logo

Q9: Which statement is NOT a decision-making statement?

Logo

Q10: Can switch statements handle string expressions in standard C++?

Logo

Q11: What happens if no case matches in a switch statement?

Logo

Q12: Which is the correct syntax for an if-else statement?

Logo

Q13: Is it mandatory to have an else block with an if statement?

Logo

Q14: What value does the expression (x == y) return?

Logo

Q15: Can the condition in if statement be any expression?

Logo

Q16: What is the purpose of the default label in switch?

Logo

Q17: Which is correct to test if x is NOT equal to y?

Logo

Q18: Which of these is a valid case label?

Logo

Q19: Can an if statement contain multiple conditions?

Logo

Q20: Which of the following is a ternary conditional operator in C++?

Are you ready to start test? Set your time limit