Question: Write in C program Write a C program, grade. c, which includes a function, calculateAverage(), that can calculate the average of an arbitrary number of
Write in C program

Write a C program, grade. c, which includes a function, calculateAverage(), that can calculate the average of an arbitrary number of test scores. Your program will not know in advance how many test scores will be entered into your function so you will need to use a sentinel value (-1) to erminate the while loop used to collect the test scores. The test scores are integers in the range 0 to 100 and the test score average should be output to two decimal places. Be sure that the user prompts and grades input into the program are displayed in the output file. Provided below is the main() function that I would like you to use for your program int main (void) int i; fp fopen ("csis.txt", " calculat eAverage () ; c.mam fclose(fp ; return 0 Please do not modify the main() function. It should appear as the first function in the program. Be sure to use function prototypes for each of the functions that are used in your program. Note that the for loop invokes the calculateAverage () function four times Each time the calculateAverage() function is invoked, a different set of test grades will be entered. Please be sure to use the data shown below: First: 78, 93, 45, 88, 89, 1 | Second : 87, 68, 100, -1 Third: 84, 86, 90, 86, 96, 68, 82, 1 Fourth: -1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
