#include <iostream.h>
#include <conio.h>
#include<stdio.h>
void main()
{
int rn;
cout<<"Enter Room number : ";
cin>>rn;
switch (rn)
{
case 1 :
printf ("Hi! This is Room 1.\n") ;
case 2 :
printf ("Hi! This is Room 2.\n") ;
case 3 :
printf ("Hi! This is Room 3.\n") ;
case 4 :
printf ("Hi! This is Room 4.\n") ;
default :
printf ("Wrong Way !!\n") ;
}
getch () ;
}
-----------------------------------------------
#include<iostream.h>
#include<conio.h>
main()
{
int n=0;
clrscr();
cout<<"\nEnter the Month Number(1-12) : ";
cin>>n;
switch(n)
{
case 1:
cout<<"\nMonth is Jan";
break;
case 2:
cout<<"\n Month is Feb";
break;
case 3:
cout<<"\nMonth is March";
break;
case 4:
cout<<"\nMonth is April";
break;
case 5:
cout<<"\nMonth is May";
break;
case 6:
cout<<"\nMonth is June";
break;
case 7:
cout<<"\nMonth is July";
break;
case 8:
cout<<"\nMonth is Aug";
break;
case 9:
cout<<"\n Month is September";
break;
case 10:
cout<<"\n Month is Oct";
break;
case 11:
cout<<"\nMonth is November";
break;
case 12:
cout<<"\n month is Dec";
break;
default:cout<<"\n Wrong input!!!";
}
getch();
return(0);
}
0 comments:
Post a Comment