i need help with this very simple question....
the default in this program will just display the wrong input
if the input entered by user is different with the data type of the variable which is char..
but not if the user entered the the word which is the character is located in front of the word...
in my program, if the user entered apple instead of 'a',this program will still print that i'm in the red team...
I want this program to display the input error..
this is my code :
#include <iostream>
using namespace std;
int main () {
char answer;
cout<<"Enter Your Team :";
cin>>answer;
switch (answer) {
case 'a' :
cout<<"You in the Red Team";
break;
case 'b' :
cout<<"You in the blue team";
break;
default :
cout<<"wrong input";
break;
}
}