Monday, December 10, 2007

How to print character or number due to the number

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: