I have to be able to have the program output invalid input if the number is not 1,2,3,4. When I run this program it automatically puts invalid for everything.
#include "stdafx.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
const int People = 5;
int i, PeopleTypes[People];
cout << "Enter 1 for Infant, 2 for Child, 3 for Teenager, or 4 for Adult\n";
cout << "for each person that attended the school function.\n\n";
for(i=0; i<People; i++)
{
cout << "Person #" << i + 1 << ": ";
cin >> PeopleTypes[i];
if (PeopleTypes[i] != 1,2,3,4)
{
cout << "This is invalid input!";
}
}
return 0;
}