You are here

getdate C

Program to print current system date, getdate C code below explain how to use this function to print computer date.

Getdate example

C programming code to print date

  1. #include<stdio.h>
  2. #include<dos.h>
  3.  
  4. main()
  5. {
  6.    struct date d;
  7.  
  8.    getdate(&d);
  9.  
  10.    printf("Current system date is %d/%d/%d\n",d.da_day,d.da_mon,d.da_year);
  11.  
  12.    return 0;
  13. }

This code will work only in Turbo C compiler.