Question: Write a C program that upon starting asks the user for their name, then displays a welcome message and prompts the user to choose one

Write a C program that upon starting asks the user for their name, then displays a welcome message and prompts the user to choose one of 3 options: 1. to play a game called Guess The Number 2. to play a game called Hangman 3. to exit the program The output of this task is shown in Figure 1. Page 5 of 10 Figure 1 If the user enters 1, the program should run a function called startGuessTheNumberGame that just prints "Guess the Number has started." If the user enters 2, the program should run a function called startHangmanGame that just prints "Hangman has started." If the user chooses 3, the program should exit. If the user enters any other number, the program should display an error message "Invalid choice." As long as the user does not enter 3, the program should carry out the appropriate action and display the menu again. The program will only exit if the user enters 3.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!