Author Topic: C program to print date  (Read 1160 times)

candy

  • Full Member
  • ***
  • Posts: 146
    • View Profile
C program to print date
« on: November 12, 2013, 01:20:25 PM »
This c program prints current system date. To print date we will use getdate function.

C programming code (Works in Turbo C only)
Code: [Select]
#include <stdio.h>
#include <conio.h>
#include <dos.h>
 
int main()
{
   struct date d;
 
   getdate(&d);
 
   printf("Current system date is %d/%d/%d",d.da_day,d.da_mon,d.da_year);
   getch();
   return 0;
}
This code works in Turbo C only because it supports dos.h header file.

Engineer Forum

C program to print date
« on: November 12, 2013, 01:20:25 PM »