For our homework assignment we have to write a program that asks the user for a list of 20 integer numbers. The program should output
the maximum and minimum values, and real average from the list.
This is what I have so far but everytime I try to add in average I get an error. Please help its due tomorrow
#include <iostream>
usingnamespace std;
int main()
{
int data, num, count, average;
int max = INT_MIN, min = INT_MAX;
int sum = INT_SUM;
cout << "Enter the number on integers" << endl;
cin >> num;
for (int count = 0; count < num; ++count)
{
cout << "please enter number" << count << endl;
cin >> data;
if (data < min)
{
min = data;
}
if (data > max)
{
max = data;
}
average = sum / count;
}
cout << " the smallest numeber is: " << min << endl;
cout << "the largest number is: " << max << endl;
return 0;
}