Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Tuesday, January 5, 2010

Write a program in C using switch case statement (Part-2)

Write a program in 'C' to enter an alphabet A or S or C and to print:-
Arts student for A,
Science student for s,
Commerce student for c,
and any other alphabet print not a student.




#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
char a;
printf("\n Enter any alphabet form A , S , C \n");
a = getchar( );
switch(a)
{
case 'A' :
printf("\n Arts student \n");
break;

case 'S' :
printf("\n Science student \n");
break;

case 'C' :
printf("\n Commerce student \n");
break;

default :
printf("\n Not a student \n");
}
}

For eg :-

Output:-
Enter any alphabet form A , S , C
Commerce student

Related Posts by Categories



0 comments:

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP