how can i see a calendar using a c program?? [closed]
suppose a date 12/12/1988 is given to you. write a c program that will display the calendar of that particular month.
The program "cal" is probably a good example.
$ cal
February 2011
Su Mo Tu We Th Fr Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28
The above was shown using a Mac OS X 10.6 system, however, almost every unix or unix-like (including linux) will likely have it.
It is described at http://en.wikipedia.org/wiki/Cal_(Unix)
As it happens, "cal" is a C program, the source code for the freeBSD version (probably the authoritative version) is at http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/ncal/
Here you can find the code for printing calender in C:
How-to-make-a-calender-in-c
the easiest way is to use
system("cal 12 1988");
but I bet that isn't what your instructor is looking for,
This is more than what you need. Go though the code and it will help you.
http://sourceforge.net/projects/c-cpp-calender/
精彩评论