#include <iostream>
int main ()
{
int age1, age2, age3, age4, age5, age6, age7, age8, age9, age10;
int TotalAge;
int AverageAge;
cout<<"Please Enter the age of student 1:" //Cout is not declared in this scope.
cin >> age1;
cout<<"Please Enter the age of student 2:"
cin >> age2;
cout<<"Please Enter the age of student 3:"
cin >> age3;
cout<<"Please Enter the age of student 4:"
cin >> age4;
cout<<"Please Enter the age of student 5:"
cin >> age5;
cout<<"Please Enter the age of student 6:"
cin >> age6;
cout<<"Please Enter the age of student 7:"
cin >> age7;
cout<<"Please Enter the age of student 8:"
cin >> age8;
cout<<"Please Enter the age of student 9:"
cin >> age9;
cout<<"Please Enter the age of student 10:"
cin >> age10;
TotalAge = age1+age2+age3+age4+age5+age6+age7+age8+age9+age10;
AverageAge = TotalAge / 10;
cout<< "The average age of students is:"
<< AverageAge;
}
1) Replace cout with std::cout
2) Put using std::cout; at the start of main()
3) Put using namepsace std; after the include. DON'T DO THIS. THIS IS BAD. DON'T DO THIS.
Where did you get this code? This would have worked on some compilers a long time ago.