Advertisement
Guest User

Untitled

a guest
Jul 31st, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include<iostream.h>
  2. #include<conio.h>
  3. #include<Windows.h>
  4. //using namespace std;
  5. struct time{
  6. int hr,min,sec;
  7. };
  8. int main()
  9. {
  10. time a;
  11. a.hr = 0;
  12. a.min = 0;
  13. a.sec = 0;
  14. for(int i = 0; i<24; i++)
  15. {
  16. if(a.hr == 23)
  17. {
  18. a.hr = 0;
  19. }
  20. for(int j = 0; j<60; j++)
  21. {
  22. if(a.min == 59)
  23. {
  24. a.min = 0;
  25. }
  26. for(int k = 0; k<60; k++)
  27. {
  28. if(a.sec == 59)
  29. {
  30. a.sec = 0;
  31. }
  32. cout<<a.hr<<" : "<<a.min<<" : "<<a.sec<<endl;
  33. a.sec++;
  34. //sleep(1000);
  35. clrscr();
  36. }
  37. a.min++;
  38. }
  39. a.hr++;
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement