Home » C Programming » Decision Making » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    float n = 12;
    switch (n)
    {
    case 1.0:
    printf("Option: First\n");
    break;
    default:
    printf("Option: Default\n");
    }
    }
    1. 12
    2. Option: First
    3. Option: Default
    4. Compilation Error
    5. None of these
Correct Option: D

Compilation Error

In function 'int main()':
error: switch quantity not an integer
switch (n)



Your comments will be displayed only after manual approval.