About Lesson
#include <stdio.h>
int main() {
int dayNumber;// Taking input for the day number
printf(“Enter a number (1 for Monday, 2 for Tuesday, etc.): “);
scanf(“%d”, &dayNumber);// Using a switch statement to determine the day of the week
switch (dayNumber) {
case 1:
printf(“Day of the week: Mondayn”);
break;
case 2:
printf(“Day of the week: Tuesdayn”);
break;
case 3:
printf(“Day of the week: Wednesdayn”);
break;
case 4:
printf(“Day of the week: Thursdayn”);
break;
case 5:
printf(“Day of the week: Fridayn”);
break;
case 6:
printf(“Day of the week: Saturdayn”);
break;
case 7:
printf(“Day of the week: Sundayn”);
break;
default:
printf(“Invalid day number. Please enter a number between 1 and 7.n”);
}return 0;
}