Monday, 23 February 2015

SWITCH CASE PROGRAM IN C


#include<stdio.h>
#include<conio.h>
main()
{
int a;
clrscr();
printf("\n Enter Number1 - ( 1 - 2 - 3 ) :");
scanf("%d",&a);

switch(a)
{
case 1:
printf("\n You Pressed Key was 1");
break;
case 2:
printf("\n You Pressed Key was 2");
break;
case 3:
printf("\n You Pressed Key was 3");
break;
default:
printf("\n Wrong Press");
break;
}
getch();
}

No comments:

Post a Comment