Good day. I am working on a program that will allow a user to enter an undefined series of numbers and enter -99 when finished. The program should output the Greatest and Least of the series entered. The instructor reccommends using a while loop and the loop is where I am getting lost. Any help is appreciated. Thanks... My code is below.
Code:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int numbers; //holds a number of integers
int numMax; //Holds max value
int numMin; //holds min value
cout << "Please enter a series of integers,\n";
cout << "when finished input -99, then press ENTER." << endl << endl;
cin >> numbers;
while (numbers != -99)
{
numMax
cout << "Greatest number in the series is: " << numMax << endl;
cout << "Least number in the series is: " << numMin << endl;
cin >> numbers
}
return 0;
}
Comment