write a program to display the given menu using switch case
B=Burger. F=French Fries. S=Sandwich. P=Pizza.
Answers
Answered by
5
C language implementation
#include <stdio.h>
int main()
{
char ch;
scanf("%c",&ch);
switch(ch) {
case 'B': printf("Burger");
break;
case 'F': printf("French Fries");
break;
case 'S': printf("Sandwich");
break;
case 'P': printf("Pizza");
}
return 0;
}
break statement is used in between the case's to avoid execution of all the cases below which it is executing.
Answered by
4
Answer:
void main( )
{
char ch;
printf("input choice");
scanf("%c",&ch);
switch('ch')
{
case'B':
printf("Burger");
break;
case'F':
printf("french fries");
break;
case'S':
printf(sandwich)
Similar questions