How to use '||' operator
To use '||' operator
#include
int main()
{ enum weeks { Sun,Mon,Tues,Wed,Thurs,Fri,Sat};
weeks DayOff;
int a;
cout << "What day would you like off (0-6)? :";
cin >> a;
DayOff = weeks(a);
if (DayOff == Sun || DayOff == Sat)
cout << "\n now is weekends\n";
else
cout << "\nI'll put this date as the vacation day.\n";
return 0;
}
Result :
No comments:
Post a Comment