Home » C Programming » Decision Making » Question
  1. Which of the following errors would be reported by the compiler on compiling the program given below?
    #include <studio.h>
    int main ( )
    {
    int a = 5;
    switch (n)
    {
    case 1 :
    ..
    case 2 :
    ..
    case 3 + 5 :
    ..
    case a :
    ..
    }
    return 0;
    }
    1. Variables cannot be checked using a switch as in case a.
    2. Expression as in case 3 + 5 is not allowed.
    3. All cases in the switch are not unique
    4. There is no break statement in each case.
    5. There is no continue statement in each case.
Correct Option: A

Variables cannot be checked using a switch as in case a.



Your comments will be displayed only after manual approval.