How to write simple C Calender program ?

Should return the week of the date

Showing Answers 1 - 6 of 6 Answers

Sudhir Venugopal

  • Aug 31st, 2011
 

By using date function you can capture the system date ! after capturing the date you can send the variable through printf("%d
", my_date); one thing more, you can check the "%d" and change d to the date belongings.

  Was this answer useful?  Yes

subbu

  • Sep 1st, 2011
 

#include <dos.h>
By using the above header file we can know about the date

Code
  1. #include<dos.h>

  2. #include<stdio.h>

  3. #include<conio.h>

  4. void main()

  5. {                          

  6.         struct date d;

  7.         getdate(&d);

  8.         printf("year %d

  9. ",d.da_year);

  10.         printf("month %d

  11. ",d.da_mon);

  12.         printf("day %d

  13. ",d.da_day);

  14.        

  15. }

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions