Computer Science, asked by rvenkatesh4697, 1 year ago

What is The Purpose Of Switch Keyword in C- Programming??

Answers

Answered by sachusoman
3
switch is used switch between different choices..
For eg :
printf("1 : ADD 2: SUB 3:DIVIDE 4: EXIT\n");
printf("Enter your choice\n");
scanf("%d",&choice)
switch(choice)
{
case 1: 
           // code for adding
           

case 2:
          // code for subtracting
case  3:
          // code for dividing
case 4:
         // code to exit from this loop
}

This is a sample code.. Not full
Answered by maynkjha
0
Please find your answer in .txt uploaded file.
Attachments:
Similar questions