Discussion :: Control Structures
-
What will be the output of the given program?
#include
void main()
{
float num=5.6;
switch(num){
case 5:printf("5");
case 6:printf("6");
default : printf("0");
break;
}
printf("%d", num);
}
Answer : Option D
Explanation :
compiler error switch expression is not integral. switch statement cannot work on float value.
Be The First To Comment