i need to write a program that asks the user for the number of days of the week and the starting day of the month and i need it to print out a months calendar
any advice?
edit: heres what ive got so far
#include <stdio.h>
int main() {
// declare variables
int numberofdays, startday;
char nameofmonth[10];
//Explains program and asks for the name of the month, and week start number
printf("This program creates a calendar for one month\nPlease enter the name of the month:");
scanf("%s", nameofmonth);
printf("Please enter the number of days in the month:");
scanf("%d", &numberofdays);
printf("Please enter the day of the week that the month starts; starting with Sunday 1-7:");
scanf("%d", &startday);
printf("%17s\nSun Mon Tue Wed Thu Fri Sat\n", nameofmonth);
printf("1 2 3 4 5 6 7"); //lost here this doesnt work...
return 0;
}
any advice?
edit: heres what ive got so far
#include <stdio.h>
int main() {
// declare variables
int numberofdays, startday;
char nameofmonth[10];
//Explains program and asks for the name of the month, and week start number
printf("This program creates a calendar for one month\nPlease enter the name of the month:");
scanf("%s", nameofmonth);
printf("Please enter the number of days in the month:");
scanf("%d", &numberofdays);
printf("Please enter the day of the week that the month starts; starting with Sunday 1-7:");
scanf("%d", &startday);
printf("%17s\nSun Mon Tue Wed Thu Fri Sat\n", nameofmonth);
printf("1 2 3 4 5 6 7"); //lost here this doesnt work...
return 0;
}