Digital Clock |
C and C++ program to show an digital clock
#include<stdio.h>
#include<conio.h>
#include<dos.h>
void main()
{
struct time t;
do
{
clrscr();
gettime(&t);
gotoxy(30,10);
textcolor(2);
cprintf("Time: %2d:%02d:%02d",t.ti_hour, t.ti_min, t.ti_sec);
delay(1000);
}while(!kbhit());
}
Output
Output
4 comments:
nice program. it is helpful.
Yes, very nice post. while looping statement is very powerful for continous. But now a days some other methods are used instead of looping. Will share on my blog soon. Have a visit to my blog.
What does !kbhit mean?
Sign up in ola app with referral code PMHV25 and earn Rs.100.
After signup use APP200 to get 200 more while riding or booking cab.Download the app from: www.ola.bz/b
Post a Comment