C Program to display current date

This program will get or read the current system date from the system. It displays Year, Month and Day.

#include <dos.h>
#include <stdio.h>

int main(void)

{
struct date d;
getdate(&d);
printf(“The current year is: %d\n”, d.da_year);
printf(“The current day is: %d\n”, d.da_day);
printf(“The current month is: %d\n”, d.da_mon);
return 0;
}

4 Responses to “C Program to display current date”

  1. Prathipa

    May 01. 2011

    PROGRAM IS NOT EORKING

    Reply to this comment
  2. sandeep pareek

    Sep 23. 2012

    bingo..
    thanx . keep your good work…

    Reply to this comment
  3. sk hossain

    Jan 27. 2013

    Gooooooooooooooood……..

    Reply to this comment

Leave a Reply