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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started