Ok...thanks Thantos. I made the changes but the compiler is kicking back errors at me. The error I get is:
c:\dev-c_~1\array.cpp: In function `int main()':
c:\dev-c_~1\array.cpp:16: invalid operands `float' and `float[21]' to binary `operator +'
Here is my code:
Code:
#include<iostream.h>
#include<stdlib.h>
int main()
{
float x[21], average, total;
int count;
for (int i=0; i<=20; i++)
{
cout<<"Enter grade:";
cin>>x[i];
}
total=total+x;
count=count+1;
average=total/20;
{
for (int i=0; i < 20; i++ )
cout << "The grade of "<<x[i]<< " has a " << (x[i]-average) << "point difference from the average of "<<average<<"\n";
}
system("PAUSE");
return 0;
}