Question: Please write in C code using #include library NOT #include . Thanks in advance! Problem 2 (40 points): Write an interactive C program that lets

Please write in C code using #include library NOT #include .Please write in C code using #include library NOT #include . Thanksin advance! Problem 2 (40 points): Write an interactive C program that

Thanks in advance!

Problem 2 (40 points): Write an interactive C program that lets a user play a game of Hangman 1) Your program gets the sccrct word (7 letters in cach word) by calling the given function: void get_word (char word[]) { char WORD[18] { "program", "circuit", "devoted", "squeeze", "journey", "puzzles", = "version", "totally", "respect" j; int i, num; num = (rand () % 9); for (i 0; i // enable use of rand() #include // enable use of time() an srand((int)time(0)); 3) Initially the program prints on the screen the number of letters of the word to be guessed. This is in the form of successive stars (see sample code execution on the next page) The player makes a guess on the letters belonging to the secret word one by one. At each step, the program prints on the screen the letters that have been guessed, and the number of wrong guesses The program should terminate when either a) all letters have been guessed correctly (the player wins) or b) a specified number of incorrect guesses have been made (the computer wins) Your program must include the following function void print_word(char x[], int len) //your code here to print elements of array x //(there are len elements in array x) Suggestion: Use another array, guessed, to keep track of the solution so far. Initialize all elements of guessed to the '*' symbol. Each time a letter in word is guessed correctly, replace the corresponding'*" in guessed with that letter

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!