Can someone tell me what i'm doing wrong:
#include "stdafx.h"
#include <iostream>
#include <iomanip>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
const int MAXGRADES = 5;
int i, grade[MAXGRADES]= {0}, count = 0;
double Avg, sum = 0;
for (i=0; i < MAXGRADES; i++, count++)
{
cout << "Enter a grade: ";
cin >> grade[i];
if (grade[i]<0)
{
cout << "This is not a correct grade";
break;
}
}
cout << endl;
for (i=0; i < count; i++)
cout << "grade " << i << " is " << grade[i] << endl;
cout <<"\nThe sum of the grades";
for (i=0; i < count; i++)
{
cout << " " << grade[i];
sum = sum + grade[i];
}
cout << " are " << sum << endl;
if (count>0)
Avg = sum / count;
cout << endl << setw(5) << "The average is: " << Avg << endl;
if (grade < Avg) // this line getting both errors
cout << "*" << grade;
return 0;
}