Thursday, 10 March 2016

C Program To Find The Day Using Switch Case

#include
#include

main()
{
//Ghanendra Yadav
int ch;

printf("Enter any number (1 to 7)");
scanf("%d",&ch);
switch(ch)
{
case  1:
printf("Today is Monday");
break;
case  2:
printf("Today is Tuesday");
break;
case  3:
printf("Today is Wednesday");
break;
case  4:
printf("Today is Thursday");
break;
case  5:
printf("Today is Friday");
break;
case  6:
printf("Today is Saturday");
break;
case  7:
printf("Today is Sunday");
break;
default:
printf("Only enter value 1 to 7");
}
getch();
}

Output:-


No comments:
Write comments

Recommended Posts × +