SWITCH CASE PROGRAM USING C,CPP
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
char a;
cout<<"ENTER A
CHARACTOR ,I WILL GIVE YOU A MIRACLE !";
cin>>a;
switch(a)
{
case'a':cout<<"ABOUT
YOU";
break;
case 'b':cout<<"b
is very good";
break;
case 'c':cout<<"IT
PARK";
break;
case'd':cout<<"TECHNOSPACE
IT PARK ";
break;
default:cout<<"\n\nU
NEED TO TYPE A OR B OR C OR D OK!";
}
getch();
}
OUTPUT:
ENTER A CHARACTOR ,I WILL GIVE YOU A MIRACLE !a
ABOUT YOU
ENTER A CHARACTOR ,I WILL GIVE YOU A MIRACLE !b
b is very good
ENTER A CHARACTOR ,I WILL GIVE YOU A MIRACLE !c
IT PARK
ENTER A CHARACTOR ,I WILL GIVE YOU A MIRACLE !d
TECHNOSPACE IT PARK
No comments: