Question: Write a c++ program that takes in numbers from the standard input and returns the sum and average. The user decide how many numbers are

Write a c++ program that takes in numbers from the standard input and returns the sum and average. The user decide how many numbers are put in!!!

Example of run:

$ g++average.cpp -o average && ./average

2

3

4

2

The sum is : 11

The average is : 2.75

Another example of run

$ g++average.cpp -o average && ./average

4

6

5

5

5

11

The sum is : 36

The average is : 6

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!