Create a program declares a vector of real numbers


Discuss teh below:

Q: Create a program that declares a vector of real numbers and input values until a 0 is entered. Add the values to the vector by using push_back(), and compute both the average and the maximum value of the numbers. Output the average and the maximum.

Use the upcoming statements that intialize max to have the value -infinity. The first real number entered will become the new maximum.

double zero = 0.0;
//start max at -infinity
double max = -1.0/zero;

 

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Create a program declares a vector of real numbers
Reference No:- TGS01937475

Now Priced at $20 (50% Discount)

Recommended (93%)

Rated (4.5/5)