What is wrong with the following code ?
switch(x)
case 1: n1 = 10;
n2 = 20;
case 2: n3 = 30;
break;
n4 = 40;
Answers
Answered by
3
Explanation:
#include <stdio.h>
void main()
{
double ch;
printf("enter a value between 1 to 2:");
scanf("%lf", &ch);
switch (ch)
{
case 1:
printf("1");
break;
case 2:
printf("2");
break;
}
}
these codes are correct
Similar questions