boost learn study
Thursday, March 27, 2014
Switch Statement
/*WAP to print the four-days of week from monday to thrusday which works upon the choice as S,M,T,H using switch case*/ #include< stdio.h >#include< conio.h >void main() { char n; clrscr(); printf("Enter the Choice from Four Days...\n") printf("S = Sunday \n") printf("M = Monday \n") printf("T = Tuesday \n") printf("H = Thursday \n\n") scanf("%c",&n); switch(n) { case 'S': printf("Sunday"); break; case 'M': printf("Monday"); break; case 'T': printf("Tuesday"); break; case 'H': printf("Thursday"); break; default: printf("Out of Choice"); break; } getch(); }
Output is as :
Enter the Choice from Four Days...
S = Sunday
M = Monday
T = Tuesday
H = Thursday
S
Sunday
Read more �
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment