Question: Please Explain step by step also. Thank you Given the code: srand(time(NULL)); int CAPACITY = 10; int a[CAPACITY]; Output Example 5 6 2 5 292

Please Explain step by step also. Thank youPlease Explain step by step also. Thank you Given the code: srand(time(NULL));

Given the code: srand(time(NULL)); int CAPACITY = 10; int a[CAPACITY]; Output Example 5 6 2 5 292 6 8 9 5.4 1. Write a loop to store random values from 0 to CAPACITY-1 inclusive into the array. 2. Write a loop to print the array and calculate the average of all values. 3. Write a line of code to print the calculated average to the console

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!