Logo 
Search:

C++ Programming Articles

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

Program for using enum

Posted By: Luduvico Fischer     Category: C++ Programming     Views: 8361

Write a program for using enum.

Code for Program for using enum in C++ Programming

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

    cout<<"\n0)Monday";
    cout<<"\n1)Tuesday";
    cout<<"\n2)Wednesday";
    cout<<"\n3)Thrusday";
    cout<<"\n4)Friday";
    cout<<"\n5)Saturday";
    cout<<"\n6)Sunday\n";

    cin>>d;

    if(d==5 || d==6)
    {
        cout<<"\n\nWEEKENDS !!!!";
    }
    else
    {
        cout<<"\n\nWEEKDAYS !!!!!";
    }
    getch();
}
  
Share: 

 
 

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

Luduvico Fischer
Luduvico Fischer author of Program for using enum is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
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!