954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Digital Clock with C

#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
void main()
{
 clrscr();
 while(!kbhit())
{
  struct time t;
  gettime(&t);
  textcolor(random(15)) ;
  gotoxy(23,3);
  printf("%d:%d:%0d",t.ti_hour,t.ti_min,t.ti_sec);
  sleep(1);
  clrscr();
 }
 getch();

}
murtazamzk
Light Poster
32 posts since Nov 2010
Reputation Points: 36
Solved Threads: 0
 

Congratulations.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

thankyou

murtazamzk
Light Poster
32 posts since Nov 2010
Reputation Points: 36
Solved Threads: 0
 

This program uses many outdated practices (void main, clrscr, kbhit) and should not be used as an example by anyone.

death_oclock
Posting Whiz
393 posts since Apr 2006
Reputation Points: 129
Solved Threads: 45
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You