Pages

Sunday, August 28, 2011

How to Show Date and Time with C and C++

The following program will show how to print system date and time using C and C++. To show date and time, this program is using __DATE__ and __TIME__ macros. These macros will show date and time on the screen.

#include<stdio.h>
#include<conio.h> 

void main()
{
    clrscr();
    textcolor(6);
    cprintf("Showing Executing Date and Time \n");
    printf("\n") ;
    textcolor(2);
    cprintf("    Date: %s ",__DATE__);
    printf("\n") ;
    textcolor(4);
    cprintf("    Time: %s ",__TIME__);
    getch();
}

Output



3 comments:

Anonymous said...

Way cool! Some very valid points! I appreciate you writing
this write-up and the rest of the site is very good.


My web-site; how much Should I weigh for my height

Anonymous said...

Great post however I was wanting to know if you could write a litte more
on this topic? I'd be very thankful if you could elaborate a little bit further. Kudos!

My weblog: calories burned walking calculator

gowtham said...

Error program