Im trying to add up 100 grades and get the averge but it wont compile because it "cannot convert from 'int' to 'int [100].
Can anyone help me??
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int total, j;
double average;
int grade[100]= (56,97,73,59,68,79,86,67,79,66,
95,64,98,56,79,83,75,89,73,91,
52,72,63,81,62,85,37,78,100,89,
56,89,75,76,99,66,84,98,68,59,
98,77,96,88,67,88,95,79,56,79,
56,97,43,59,68,79,85,67,79,66,
95,64,98,65,79,83,75,89,73,91,
52,72,63,49,62,85,37,78,100,89,
84,89,75,76,99,66,84,98,68,59,
98,77,96,88,67,88,95,79,56,79);
char pause;
for(int j=0; j<100; j++)
{
total=total + grade[j];
}
average=total/100;
cout<<"Your average is "<<average<<endl;
cin>>pause;
return 0;
}