Answered step by step
Verified Expert Solution
Link Copied!

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******image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Annoyance about a statement that has been made by somebody

Answered: 1 week ago