PDA

View Full Version : ساعت و تقویم کی میتونه بنریسه



Mohammadvb6
دوشنبه 18 اردیبهشت 1385, 14:21 عصر
ساعت و تقویم کی میتونه بنریسه

SwordFish
چهارشنبه 10 خرداد 1385, 07:50 صبح
#include <stdio.h>
#include <dos.h>
#include <conio.h>
#include <time.h>
int main(void)
{
time_t curtime; // Define a Varible of type time_t.
textmode(C80);
clrscr(); // for Clear Screen.
textcolor(10); // Change Text Color into Green .
while (!kbhit())
{ // This Loop will Continue until when press a key of Keyboard.
time(&curtime); // For Geting Current Date & Time .
gotoxy(1,1); // For Change location of the cursor .
cprintf("Currnet Date and Time is : %s\n",ctime(&curtime));
delay(1000); // Delay about 1 second.
}
return 0;
}