Green University of Bangladesh: Department of Computer Science and Engineering (CSE)
Green University of Bangladesh: Department of Computer Science and Engineering (CSE)
Student Details:
Name ID
Program Interface:
1.Start
2.Take a character type string array enter month names. And also take array
called ‘daysinmonth’ and enter total days in each month.
3. Read a favorite year you want to see in calendar.
4.Now taking a for loop to print month and week days name. And take a
nested for loop to enter space before new month. And a nested for loop to
print each date of month.in nested loop use a ‘if’ condition to line break when
week days is 7.
5.Taking a ‘if’ condition before all loop to solve leap year problem.so that we
can get exactly same days if it’s also a leap year.
6.Now taking a function before main function to return first day of a year.
Using ‘firstdayoftheyear’ this function. And return this value before entering
the loop.
Program Execution:
#include<stdio.h>
int main(){
char *months[]={"January","February","March","April"," May "," Jun "," July
","August","September","October","November","December"};
int daysinmonths[]={31,28,31,30,31,30,31,31,30,31,30,31};
int i,j,totaldays,weekday=0,spacecounter=0,year;
for(spacecounter=1;spacecounter<=weekday;spacecounter++){
printf(" ");
}
totaldays=daysinmonths[i];
for(j=1;j<=totaldays;j++){
printf("%6d",j);
weekday++;
return 0;
}
Input and Output:
Program Structure:
Difficulties Encountered:
It is a new language of me so. It took while to understand but now I am quite
comfortable than before. By doing this project I face few difficulties using
strings/functions because I learn then recently. But by practicing regular now
I have clear concept about it.in this project I use loop and array more than
others topic. I face few problems but now I overcome It and I successfully
did my project. Calendar is one of the most useful things in our regular life
that is the main reason, why I chose this topic for my lab project.
Conclusions:
As we all know calendar is use for counts days. By using C program, we can
make a calendar quite easily. Even I also did this quite easily and the reason
I chose this topic because personally I use calendar more and when I was
thinking about project topic then first thing that come into my mind is calendar
and eventually, I did few research and then I chose the easiest and most
uncomplicated way to create a calendar which you already maybe noticed in
my project. I may face few difficulties but somehow, I finally did this quite
comfortably. And finally, when it works properly it was a great feeling.
References: