Question: c++ program please Implement a function named generate that receives four integers by reference and stores in them four unique random integers in the range

c++ program please c++ program please Implement a function named generate that receives four integers

Implement a function named generate that receives four integers by reference and stores in them four unique random integers in the range [0, 9]. Write a simple program to test your function. Assume the Five digits are called a, b, c, d and e. You can use the following algorithm: 1. Generate the first random digit and assign it to a. 2. Generate another random digit and assign it to b. If b is the same as a, then keep generating new random digits until a new unique number is generated. Assign this number to b. 3. Repeat the same thing for c and d. The idea is to keep generating digits as long as they are equal to one of the already generated digits and stop when a new (unique) one is generated

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!