Home » C Programming » Decision Making » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int n = 98;
    switch (n)
    {
    case 'b':
    printf("Right... ");
    break;
    case 98:
    printf("Wrong...\n");
    break;
    }
    }
    1. Character case value error
    2. Right...
    3. Wrong...
    4. Duplicate case value error
    5. None of these
Correct Option: D

Compilation Error

In function 'int main()':
error: duplicate case value
case 98:
error: previously used here
case 'b':



Your comments will be displayed only after manual approval.