Write a program that utilizes a DO-WHILE loop to redisplay a menu to the user. Ask the user to input their favorite SuperHero and display a positive or funny comment about the chosen SuperHero. If RBG is chosen, display "You can't spell TRUTH without RUTH." Utilize a Do-While Loop to redisplay the menu to the user after item 1, 2 or 3 is executed. If item 4 is chosen, end the program. If the user chooses 4, end the program. 1. Superman (or a SuperHero of your Choice) 2. Batman (or a Superhero of your choice) 3. The Notorious RBG (non-negotiable, RBG must be a menu choice) 4. Quit.
CODE IN C:
#include <stdio.h>
int main()
{
int choice = 0;
do{
printf("1. Super Man\n");
printf("2. Bat Man\n");
printf("3. The Notorious RBG\n");
printf("4. Quit\n");
printf("\nEnter your choice : ");
scanf("%d", &choice);
switch(choice){
case 1:
printf("You can't have a good soul without a proper
goal.\n");
break;
case 2:
printf("dont fear i am here.\n");
break;
case 3:
printf("You can't spell TRUTH without RUTH.\n");
break;
case 4:
printf("Thank you...\n");
break;
default:
printf("Invalid input...\n");
}
}while(choice != 4);
return 0;
}
Get Answers For Free
Most questions answered within 1 hours.