Question: i need help with this Program as soon as possible This to start you off #include void r_avg(int, int); int main(int argc, char *argv[]) {

i need help with this Program as soon as possible
This to start you off
#include
void r_avg(int, int);
int main(int argc, char *argv[])
{
int input; int count=0; int sum=0;
printf("Enter number (-1 to quit): ");
scanf("%d", &input);
while(input != -1)
{
......
......
r_avg(sum, count);
/* read again */
}
return 0;
}
void r_avg(int sum, int count)
{
....
double resu = ..
printf("running average is ....", ...);
}
i need help with this Program as soon as possible This to

Specification Complete the ANSI-C program runningAveLocal.c, which should read integers from the standard input, and computes the running (current) average of the input integers. The program terminates when -1 is entered. Implementation Define a function void r_avg(int sum, int count) which, given the current sum sum and the total number of input count, computes and displays the running average in double. The current sum and input count are maintained in main. Complete main so that input is read and maintained. Sample Inputs/Outputs: red 307 % gcc -Wall runningAveLocal.c red 308 % a.out Enter number (-1 to quit): 10 running average is 10 / 1 - 10.000 Enter number (-1 to quit): 20 running average is 30 / 2 = 15.000 Enter number (-1 to quit): 33 running average is 63 / 3 - 21.000 Enter number (-1 to quit): 47 running average is 110 / 4 = 27.500 Enter number (-1 to quit): 51 running average is 161 / 5 = 32.200 Enter number (-1 to quit): 63 running average is 224 / 6 = 37.333 Enter number (-1 to quit): -1 red 309 %

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!