48

int main()
{
float a=1;
switch(a)

{
case 1:
printf("%f",a);
break;
defualt:
printf("Default");
}
return 0;
}

Output:


Compilation Error

LOGIC


we can use only integer constants or character constants in switch case. We can't use float values in switch case.

Related Posts