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<stdio.h> 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 Ladder if or else if statement The marks obtained by a student in 5 different subjects are input through the keyboard. The studennested if statement /*If the ages of Ram, sham and Ajay are input through the keyboard, write a program to determine Conditional Control Statement ? : /*The easiest way to use conditional control statement*/ #include #include void main() { int n;If Statement - C Programming /*Any Number is input through the keyboard. write a If program.*/ #include #include void main() {if-else statement - C Programming /*Any Number is input through the keyboard. write a program to find out whether It is and Odd Numb
ConversionConversion EmoticonEmoticon