int main ()
{
const int SENTINEL = -99;
int num;
int min = SENTINEL, max = SENTINEL;
int sum = 0, count = 0;
do {
cout << "Enter a number (-99 to quit): ";
cin >> num;
if( 1 <= num && num <= 100 )
{
if ( min == SENTINEL || num < min )
min = num;
if( max == SENTINEL || num > max )
max = num;
sum += num;
count++;
} else if( num != SENTINEL )
cout << num << " is out of range" << endl;
} while( num != SENTINEL );
return 0;
}
void table(int num, int max, int min)
{
for (num = min; num <= max; num++)
{
cout << setw(3) << num << '\t';
cout << '\n';
}
cout << 'n';
}
void numbers(int min, int max, int count)
{
cout << fixed << showpoint << setprecision(1);
cout << "The smallest value is: " << min;
cout << "\nThe largest value is: " << max;
cout << "\nTotal values: \n" << count;
cout << "\nThank your for your time." << endl;