i have made a code which allows a user to input the amount of days in a month and the start day and then displays a calander for that month. I now what to extend it to display each month of the year under neath each other. Any ideas how i would acomplish this?
#include
main()
{
int i, n, day;
printf("enter number of days in the month:");
scanf("%d",&n);
printf("Enter starting day of the week (1=Sun, 7=Sat):");
scanf("%d",&day);
printf(" S, M, T, W, T, F, S\n");
for ( i=0; i<(day-1); i++ )
printf(" ");
for (i=1; i <= n ; i++)
{
if (i==(9-day) ||i==(16-day) || i==(23-day) || i==(30-day))
{
printf("\n");
}
printf("%3d", i);
}
return 0;
}