Switch Statement C Programming /*Write A Program to print the four-days of week from Monday to Thursday which works upon the choice as S,M,T,H using switch case*/ #include void main() { char n; 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; } } Output is as : Enter the Choice from Four Days... S = Sunday M = Monday T = Tuesday H = Thursday S Sunday Read more » Tweet Share Share Share Share Related Post
ConversionConversion EmoticonEmoticon