Question: Create a simple lottery program using C. A user will input four integer values between 0 and 9. Your program will then randomly generate four


Create a simple lottery program using C. A user will input four integer values between 0 and 9. Your program will then randomly generate four random integer numbers and compare them with the user's inputs. Use a two-dimensional array to store all numbers, i.e. user inputs in column 1 and computer generated numbers in column 2 of the array. Your program should also prompt user to re-enter the value if it exceeds 9. Likewise, it the input is less than 0, your program should also prompt for re-entry. Declare "Win" if at least two consecutive computer generated numbers are the same as user's inputs. If all the four numbers are the same, then declare "Strike" Otherwise, "Loose". See Figure 4 for sample execution and output. Enter an integer value between 0 and 9: 2 Enter an integer value between 0 and 9: 9 Enter an integer value between 0 and 9: 19 Invalid input. Integer should be between 0 and 9 only. Enter an integer value between 0 and 9: 3 Enter an integer value between 0 and 9: 6 Your input numbers are 2 9 3 6 Computer generated numbers are 1 8 1 7 *** RESULTS *** Loose
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
