Question: Write a program that declares a vector of real numbers, and inputs values until a 0 is en- tered. Add the values to the
Write a program that declares a vector of real numbers, and inputs values until a 0 is en- tered. 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 initialize max to have the value. The first real number en- tered will become the new maximum. ORT: double zero = 0.0; // start max at -infinity double max = -1.0/zero;
Step by Step Solution
3.53 Rating (160 Votes )
There are 3 Steps involved in it
program to find the average and the maximum value from the given vectors INPUT a vector of real numb... View full answer
Get step-by-step solutions from verified subject matter experts
