Question: Write a C/C+ program that uses the random number generator function srand() with a for loop to create a vector of N random integers between

 Write a C/C+ program that uses the random number generator function

Write a C/C+ program that uses the random number generator function srand() with a for loop to create a vector of N random integers between Min and Max. After creating your random number vector, have your program sort the random numbers into the following bins: Bin A: between 67% and 100% of Max Bin B: between 33% and 67% Max Bin C: between 0 and 33 % Max Bin a: all random numbers evenly divisible by 3 Bin b: all RN evenly divisible by 7 Bin c: all random numbers evenly divisible by 11 Bin d: all random numbers evenly divided by 13 After writing your program; test your program for inputs N= 5000, Min = 0, Max = 33333 and print out the results for each bin. Note you only need to count the number of elements in each bin, it is not necessary to save the actual values of the random numbers

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!