win98se

ProgrammingGo - simpledc.cpp

Nov 21st, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream.h>
  2. #include <stdlib.h>
  3. #include <dos.h>
  4. #include <conio.h>
  5.  
  6. void main()
  7. {
  8.     clrscr();
  9.     struct time t;
  10.     char hr[5], min[5], sec[5];
  11.     while(1)
  12.     {
  13.         gettime(&t);
  14.         clrscr();
  15.         if(kbhit())
  16.             break;
  17.         gotoxy(10, 10);
  18.         itoa(t.ti_hour, hr, 10);
  19.         itoa(t.ti_min, min, 10);
  20.         itoa(t.ti_sec, sec, 10);
  21.         cout<<hr<<":"<<min<<":"<<sec;
  22.         sleep(1);
  23.     }
  24. }
Add Comment
Please, Sign In to add comment