Computer Science, asked by subassr5633, 5 hours ago

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 hope262
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