Question: Question 3 (30 marks) Create a simple lottery program using C. A user will input four integer values between 0 and 9. Your program will

 Question 3 (30 marks) Create a simple lottery program using C.

A user will input four integer values between 0 and 9. Your

Question 3 (30 marks) Create a simple lottery program using C. A user will input four integer values between 0 and 9. Your program will then randomly generate fou r random integer numbers and compare them with the user's inputs. Use a two-dimensional array to store all numbers, i.ee. 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

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!