Write your question here.
Basically the user is told "Enter N" Then my program will allow the user to enter the following N integers, one at a time. After the user has input all N integers your program will output the following:
* The maximum value (int) of all entered integers
* The minimum value (int) of all entered integers
* Their average value (double) of all entered integers. This average value carries TWO (2) decimal precision.
Output should look like this:
Please enter N: 4
Integer #1: 2
Integer #2: -34
Integer #3: 344
Integer #4: 3
Max: 344
Min: -34
Average: 78.75
#include <iostream>
#include <string>
#include <limits.h>
usingnamespace std;
int main()
{
int N = 0, max = INT_MIN, min = INT_MAX, sum = 0;
float average = 0.0;
std::cout << "Please enter N: ";
std::cin >> N;
std::string phrase = "Integer # ";
int count = 0, number;
while (count++ < N)
{
std::cout << phrase << count << '\t';
std::cin >> number;
// Process the input i.e. number here
}
return 0;
}