C Programming Tips & Tricks





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Code Snippets
 List All
 Arrays
 Calculators
 Datatypes
 Date & Time
 File Manipulation
 Math Functions
 Multimedia
 Others
 




Display Date - C

Snippets  C  Display Date
Snippet On
Display Date




Code
  
Rate this page :
  [ 0 votes]


#include <stdio.h>
#include <dos.h>
#include <stdlib.h>
#include <bios.h>
int main(void)
{
struct date DATE;
clrscr();
getdate(&DATE);
printf(<q>The year is : %d\n</q>,DATE.da_year);
printf(<q>The month is : %d\n</q>,DATE.da_month);
printf(<q>The day is : %d\n</q>,DATE.da_day);
return 0;
}

Output:
======
The year is : 2010
The month is : 04
The day is : 29




Other Links

web hosting