// Can anyone please tell me that what is wrong with my programme? I'm trying to learn arrays. I understood the concept but this programme is not giving right answer. It always gives 6366923 as the final answer. What to do? :/
#include <iostream.h>
#include <conio.h>
int main()
{
int age[6];
int sum;
int count;
int avg;
for(count=0; count<6; count++)
{
cout<<"Enter the age of the student"<<count<<":";
cin>>age[count];
}
sum=0;
for(count=0; count<10; count++)
{
sum= sum+ age[count];
}
avg = sum/6;
cout<<"The average age of the class is ="<<avg;
getch();