using namespace std;
void main ()
int x, y;
cout<<"Input number of Subjects ";
cout<<"Input of number of exams per subjects ";
for (int i = 1 ; i <= x ; i++)
for (int j = 1 ; j <= y ; j++)
cout<<"Input grades on Exam "<<j<<" ";
for(int i=0; i<x; i++)
for(int j=0; j<y; j++)
ave[y] = sum/y;
cout<<"subject "<<i+1<<"average is "<<ave[y];
This is obviously the wrong code.
The output should be the average of the exam per subject. Which is I don't know how to do it. Help please?
the same for
an array starts with 0. hence the loop is supposed to be
for (int i = 0 ; i < x ; i++)
for (int j = 0 ; j < y ; j++)
if you want start with 1 in your cout just put
i + 1
Last edited on
Your indexes are inconsistent.
That's the only problem.-.- It worked now.:/ Thanks guys. xD