Question: use c language O Using the addlist.c example as a model, write a program that reads in a list of ntegers until the user enters
use c language 
O Using the addlist.c example as a model, write a program that reads in a list of ntegers until the user enters the value -1 as a sentinel. At that point, the pro- aram should display the average of the values entered so far. Your program should be able to duplicate the following sample run: This program averages a list of integers. Enter -1 to signal the end of the list. ? 95J ? 100.J ? 89.1 ? 91.J ? 97J ?-1J The average is 94.4 Writing this program requires more thought than writing the addlist.c pro- Bram in the text and is a good test of your problem-solving abilities. TA comment: We have provided a sample input file as well as a sample output file for this program. TA comment: In C, 0 is set to be FALSE and 1 is set to be TRUE. So, you can do while (1) instead of while(TRUE). Also, in the version of the C compiler in CSIF, TRUE is not defined by default. So, if you want to use TRUE, you will have to manually define it in the code. You can do this by saying: #define TRUE 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
