Question: Ex 3. Pass-by-Reference (20 points) Create a file named ex3.cpp and add your name and ID at the top of the file as a comment

 Ex 3. Pass-by-Reference (20 points) Create a file named ex3.cpp and

Ex 3. Pass-by-Reference (20 points) Create a file named ex3.cpp and add your name and ID at the top of the file as a comment Implement a function named generate that receives four integers by reference and stores in them four unique random integers in the range [0, 5]. Write a simple program to test your function. Assume the four digits are called a, b, c and d. You can use the following algorithm Generate the first random digit and assign it to a. 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

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!