--:--









Quiz for switch-case

Course: C Language | Subject: Unit 3 | Topic: Control Statements



Logo

Q1: Which keyword is used to exit from a switch statement in C?

Logo

Q2: What happens if break is omitted in a switch case?

Logo

Q3: Which data type is not allowed in switch expression in C?

Logo

Q4: Which statement is optional in switch-case structure?

Logo

Q5: How many default cases can a switch statement have?

Logo

Q6: Can a switch statement be nested inside another switch?

Logo

Q7: In C, switch expression must be of which type?

Logo

Q8: What is the default behavior if no case matches and there is no default?

Logo

Q9: Where can the default case appear in a switch statement?

Logo

Q10: Can we use string in switch expression in C?

Logo

Q11: What will happen if two cases have the same value?

Logo

Q12: Which is the correct syntax of a case label?

Logo

Q13: Which statement is best to jump out of a switch immediately?

Logo

Q14: Can a case value be a variable?

Logo

Q15: Can we use logical operators in a case value?

Logo

Q16: Is break mandatory after each case?

Logo

Q17: What is the purpose of default case in switch?

Logo

Q18: Can we have expressions like case 1+2 in C?

Logo

Q19: What happens if break is used in default?

Logo

Q20: Which header is needed to use switch in C?

Are you ready to start test? Set your time limit