write a program that will accept a number and displaying the corresponding day of the week
Answers
Answered by
2
#include <stdio.h>
int main()
{
int day;
printf("Enter number 1-7 :");
scanf("%d", &day);
/* Determine the corresponding week's day */
switch (day)
{
case 1:
printf("Sunday");
break;
case 2:
printf("Monday");
break;
case 3:
printf("Tuesday");
break;
case 4:
printf("Wednesday");
break;
case 5:
printf("Thursday");
break;
case 6:
printf("Friday");
break;
case 7:
printf("Saturday");
break;
default:
printf("Invalid input");
}
return 0;
}
panku29:
hi
Similar questions