Answered step by step
Verified Expert Solution
Question
1 Approved Answer
******PLEASE USE A FOR LOOP IN C LANGUAGE****** Activity 2 Write a program that continuously reads an integer number and stores it into an array
******PLEASE USE A FOR LOOP IN C LANGUAGE******
Activity 2 Write a program that continuously reads an integer number and stores it into an array with size of N. The whole code should be a function of N, and make N equals to five (N-5). The index resets to O after writing the Nth data (N-1 index). Determine the average value of the numbers in the array. Display the elements of the array and the average. Initialize all elements of the array with O int num[5] 00 0 0 0 Enter a value: 10 1) num 1000 0 0 ave - (float) 10/ Enter a value: 11 2) num 10 11 0 0 0 ave- (float) 21/ Enter a value: 12 ave- (float) 33/ 3) num 10 11 12 0 0 Enter a value: 13 4) 10 1112 13 0 ave (float) 46/ num Enter a value: 14 5) 10 1112 13 14 ave (float) 60/ num At index N-1, the next index is 0 Enter a value: 15 6) 15 1112 13 14 ave- (float) 65/ num Enter a value: 14 7) num 15 14 12 13 14 ave- (float) 68/Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started