Program to use the enum in c++
#include<iostream>
using namespace std;
enum days{ sat=0, sun, mon, teu, wed, thirs, fri };
void main()
{
int no; enum days d;
cout << "Enter the day:";
cin >> no;
d = (days)no;
if (d ==sat || d == sun){ cout << "Holidays" << endl; }
else cout << "Working days" << endl;
getchar();
getchar();
}
Comments
Post a Comment