开发者

how can i see a calendar using a c program?? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and 开发者_如何学C cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜