Logo 
Search:

C++ Programming Articles

Submit Article
Home » Articles » C++ Programming » Homework HelpRSS Feeds

Demonstrating enum keyword

Posted By: Keana Schmidt     Category: C++ Programming     Views: 2914

Write a program demonstrating enum keyword.

Code for Demonstrating enum keyword in C++ Programming

#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();
}
  
Share: 


Didn't find what you were looking for? Find more on Demonstrating enum keyword Or get search suggestion and latest updates.

Keana Schmidt
Keana Schmidt author of Demonstrating enum keyword is from Frankfurt, Germany.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!