hey guys, Im having a problem with the following piece of code for soem reason when i execute the program and test this part, lets say the first if statement is true and its supposed to print out "blah blah blah", it prints that out but then goes on to also print the else part which is "failed", This doesnt happen with the second IF only the first one. So any ideas on how i can make it not print the else for the first IF? Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13
case'3':
cout<<"Please enter student ID: ";
cin >> ID2;
if (ID2 == ID[0]){
cout<<"blah blah blah"<<endl;
}
if (ID2 == ID[1]){
cout<<"ha ha ha"<<endl;
}
else {
cout<<"failed"<<endl;
}
break;