What it does is ask the user to put numbers and then it will take the average.
Hey so i was wondering how would i be able to tell the program ignore a users input if he put a negative number it, just ignores it but solves for the numbers that are positive. Which means it would just ignore it and only solve for the ones to be averaged
#include <iostream>
usingnamespace std;
/**********************************************************************
* Main well got lazy on creating different functions so I put everything
* in main.
***********************************************************************/
int main()
{
constint SIZE = 10;
int grades [SIZE];
int average;
average = 0;
for (int i = 0; i < SIZE; i++)
{
cout << "Grade " << i + 1 << ": ";
cin >> grades[i];
average = average + grades[i];
}
average = average / SIZE;
cout << "Average Grade: ";
cout << average;
cout << "%" << endl;
return 0;
}