Back To C++ Flow of Control Index
//program to input a character and check whether it is equal to a or b using if statement example of OR ( || ) operator #include
#include
void main() { int ch; clrscr(); cout<<"enter a character"; cin>>ch; if((ch=='a') || (ch=='b')) { cout<<"you entered either a or b"; } getch(); }