

MCQOPTIONS
Saved Bookmarks
1. |
Which of the following statements is correct about the C#.NET code snippet given below? switch (id) { case 6: grp = "Grp B"; break; case 13: grp = "Grp D"; break; case 1: grp = "Grp A"; break; case ls > 20: grp = "Grp E"; break ; case Else: grp = "Grp F"; break; } |
A. | Compiler will report an error in case ls > 20 as well as in case Else. |
B. | There is no error in this switch case statement. |
C. | Compiler will report an error only in case Else. |
D. | Compiler will report an error as there is no default case. |
Answer» B. There is no error in this switch case statement. | |