Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

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

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

Explain consumer behaviour.

Answered: 1 week ago

Question

Explain the factors influencing consumer behaviour.

Answered: 1 week ago