#include<iostream>
using namespace std;
int main()
{
int month;
cout<<"Enter the month of the year you want to check: ";
cin>>month;
switch(month)
{
case 1:
cout<<"Month 1 is January";
break;
case 2:
cout<<"Month 2 is February";
break;
case 3:
cout<<"Month 3 is March";
break;
case 4:
cout<<"Month 4 is April";
break;
case 5:
cout<<"Month 5 is May";
break;
case 6:
cout<<"Month 6 is June";
break;
case 7:
cout<<"Month 7 is July";
break;
case 8:
cout<<"Month 8 is August";
break;
case 9:
cout<<"Month 9 is September";
break;
case 10:
cout<<"Month 10 is October";
break;
case 11:
cout<<"Month 11 is November";
break;
case 12:
cout<<"Month 12 is December";
break;
default:
cout<<"Invalid Entry.";
}
}
using namespace std;
int main()
{
int month;
cout<<"Enter the month of the year you want to check: ";
cin>>month;
switch(month)
{
case 1:
cout<<"Month 1 is January";
break;
case 2:
cout<<"Month 2 is February";
break;
case 3:
cout<<"Month 3 is March";
break;
case 4:
cout<<"Month 4 is April";
break;
case 5:
cout<<"Month 5 is May";
break;
case 6:
cout<<"Month 6 is June";
break;
case 7:
cout<<"Month 7 is July";
break;
case 8:
cout<<"Month 8 is August";
break;
case 9:
cout<<"Month 9 is September";
break;
case 10:
cout<<"Month 10 is October";
break;
case 11:
cout<<"Month 11 is November";
break;
case 12:
cout<<"Month 12 is December";
break;
default:
cout<<"Invalid Entry.";
}
}
No comments:
Post a Comment