PROGRAM ON ENTERING THE MONTH
#include<iostream.h>
#include<conio.h>
void main()
{
int month;
clrscr();
cout<<"Enter the no. of month(1-12):";
cin>>month;
switch(month)
{
case 1: cout<<"\n"<<"January";
break;
case 2: cout<<"\n"<<"February";
break;
case 3: cout<<"\n"<<"March";
break;
case 4: cout<<"\n"<<"April";
break;
case 5: cout<<"\n"<<"May";
break;
case 6: cout<<"\n"<<"June";
break;
case 7: cout<<"\n"<<"July";
break;
case 8: cout<<"\n"<<"August";
break;
case 9: cout<<"\n"<<"September";
break;
case 10: cout<<"\n"<<"October";
break;
case 11: cout<<"\n"<<"November";
break;
case 12: cout<<"\n"<<"December";
break;
default: cout<<"\n"<<"Wrong no. of month!!!!";
break;
}
getch();
}
#include<conio.h>
void main()
{
int month;
clrscr();
cout<<"Enter the no. of month(1-12):";
cin>>month;
switch(month)
{
case 1: cout<<"\n"<<"January";
break;
case 2: cout<<"\n"<<"February";
break;
case 3: cout<<"\n"<<"March";
break;
case 4: cout<<"\n"<<"April";
break;
case 5: cout<<"\n"<<"May";
break;
case 6: cout<<"\n"<<"June";
break;
case 7: cout<<"\n"<<"July";
break;
case 8: cout<<"\n"<<"August";
break;
case 9: cout<<"\n"<<"September";
break;
case 10: cout<<"\n"<<"October";
break;
case 11: cout<<"\n"<<"November";
break;
case 12: cout<<"\n"<<"December";
break;
default: cout<<"\n"<<"Wrong no. of month!!!!";
break;
}
getch();
}
Comments
Post a Comment