Question: Write a program that simulates a lottery. The program should have an array of eight integers named lottery and should generate a random number in
Write a program that simulates a lottery. The program should have an array of eight
integers namedlotteryand should generate a random number in the range of
through for each element in the array. The user should enter eight digits, which should
be stored in an integer array nameduser The program is to compare the corresponding
elements in the two arrays and keep a count of the digits that match. For example,
the following shows thelotteryarray and theuserarray with sample numbers stored
in each. There are two matching digits elements and
lottery array:
user array:
The program should display the random numbers stored in thelotteryarray and the
number of matching digits.
Also output the values that are the same andoutput how many numbers are the same.
I need a function for the user array and a function for the lottery array.
in c
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
