Rewrite the follwing using switch case
#include
void main()
{
int x;
puts("enter a value")
scanf("%d",&x);
if (x==1)
printf("java");
else if (x==2)
printf(" foxpro");
else
printf("python");
}
Answers
Answered by
0
Answer:
I am skipping till scanf part and answering from if portion.
switch(x)
{
case '1':
printf("java")
break;
case '2':
printf("foxpro")
break;
default:
printf("python")
}
Hopefully, this helps.
Similar questions