-
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");
}
}
-
- 12
- Option: First
- Option: Default
- Compilation Error
- None of these
Correct Option: D
Compilation Error
In function 'int main()':
error: switch quantity not an integer
switch (n)