#include <ostream.h>
using namespace std;
int main() {
int grades[5], avg, x;
cout<<" Type in your 4 main grades: \n\n";
cout<<"Social Studies: ";
cin >> grades[0];
cout<<"Math: ";
cin >> grades[1];
cout<<"Science: ";
cin >> grades[2];
cout<<"English: ";
cin >> grades[3];
// average them all
avg=0;
for(x=1; x<5; x++)
avg += grades[x];
avg /= 5;
cout<<"Your Average is: "<< avg<<'\n';
cin.get();
return 0;
}
is there somthin wrong with this or is it that u cannot add vales to arrays?? i want the final outcome to show the average but instead it shows 502328282 y?
MÃ
§~|~®GÃ(v)R~