I know my code is close but it doesn't quite work.
It supposed to take in the day of the week the calendar starts on and the number of days in the month.
Can I please get help correcting?
int main(void)
{
int start_day, days_in_month, i, day_of_week;
printf("Enter start day: ");
scanf("%d", &start_day);
printf("Enter days in month: ");
scanf("%d", &days_in_month);
for (i = 1 ; i < start_day; i++) {
printf(" ");
}
for (i = 1; i <= days_in_month; i++) {
printf("%2d ", i);
if ((i + start_day - 1) % 7 == 0) {
printf("\n");
}
}
return 0;
}