> Why is my program not working. It opens without any errors and it allows me to input data, but it will not answer the qu

Why is my program not working. It opens without any errors and it allows me to input data, but it will not answer the qu

Posted at: 2014-12-18 
include

using namespace std;

int main()

{

int age;

intageTotal = 0;

int numberOfPeopleEntered = 0 ;



cout << "enter first persons age or -1 to quit" << endl;

cin >> age;



while(age != -1){

ageTotal = ageTotal + age;

numberOfPeopleEntered++;



cout << "enter next persons age or -1 to quit" << endl;

cin>> age;

}



cout << "number of people entered: " << numberOfPeopleEntered << endl;

cout << "average age: " << agetotal/numberOfPeopleEntered;

return 0;

}