C++ Programming Blog

 
 
 
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
enum days{Monday,Tuesday,Wednesday,Thrusday,Friday,Saturday,Sunday};
void main()
{

    int d;
    cout<<\"1)Monday\\n2)Tuesday\\n3)Wednesday\\n4)Thrusday\\n5)Friday\\n6)Saturday\\n7)Sunday\";

    cout<<\"\\nEnter the day no::\");
    cin>>d;

    if(d>5 and d<6)
    {
        cout<<\"\\nWeekend!!\";
    }
    else
        cout<<\"\\nWeekdays!!\";
    getch();
}

 
 
Didn't find what you were looking for? Find more on Demonstrating enum keyword