Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Tuesday, January 5, 2010

Write a program in 'C' using switch case statement.

Write a program in C where the numbers 1,2,3 represent first,second and Third Class & the no. 4 represent fail or any other number print not suitable.



#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
int n;
printf("Enter any integer from 1 to 4 \n");
scanf("%d", &n);
switch(n)
{
case 1:
printf("\n First Class \n");
break;

case 2:
printf("\n Second Class \n");
break;

case 3:
printf("\n Third Class \n");
break;

case 4:
printf("\n Fail \n");
break;

default :
printf("\n Not Suitable \n");
}
return(0);
}


For eg :-

Output :-
Enter any integer from 1 to 4
1
First Class

Related Posts by Categories



0 comments:

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP