C Programming :: Control Instructions - Discussion
Home > C Programming > Control Instructions > MCQs Questions Discussion
4 / 33
What is the output of the following 'C' program?
#include<stdio.h>
void main()
{
float i=1.5;
switch(i)
{
case 1: printf("1");
case 2: printf("2");
default : printf("0");
}
}
#include<stdio.h>
void main()
{
float i=1.5;
switch(i)
{
case 1: printf("1");
case 2: printf("2");
default : printf("0");
}
}
A1 2 0
B2
CCompiler error: switch quantity not an integer
D1
ENone of these
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
The expression used in switch must be integral type ( int, char and enum). Any other type of expression is not allowed.
Read Full Answer
Report Error
Please Login First Click Here