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[]) {
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
Get step-by-step solutions from verified subject matter experts
