thanks guys i'm sorry but i'm having some trouble. i'm trying to write a program that prints a one-month calendar, the user specifies the number of days in the month and the day of wich the month begins. here's my src:
Code:
#include <stdio.h>
main() {
int i, n, j;
printf("Enter number of days in month: ");
scanf("%d", &n);
printf("Enter starting day of the week (1=Sun, 7=Sat): ");
scanf("%d", &j);
for (i = 1; i <= n; i++) {
printf("j = %d", j);
j++;
if (j > 7) {
printf("\n");
j = 1;
}
}
return 0;
}
i'm sorry i have two probs:1) i don't know how to make the the month begin on a specific day(ex. the month begins on thursday). 2) i don't know how to make the program start a new line. i think this problem is because of the first prob.
thanks