if(toupper(b)!='I'||toupper(b)!='E')
This is true for all values of b, including I and E. When b=='I' toupper(b) != 'E' is true, and when b == 'E', toupper(b) != 'I' is true.
You only need to us the second condition:
1 2 3 4 5 6 7 8
for (i = 0; i < 10; i++) {
cin >> b;
if (toupper(b) == 'I' || toupper(b) == 'E') {
break;
} else {
cout << "enter the correct choice";
}
}
thanks :) got the logic. it worked after making minor changes in the program i had to remove the brackets from the break and else statement.after that your solution worked fine