Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- #include<conio.h>
- #include<Windows.h>
- //using namespace std;
- struct time{
- int hr,min,sec;
- };
- int main()
- {
- time a;
- a.hr = 0;
- a.min = 0;
- a.sec = 0;
- for(int i = 0; i<24; i++)
- {
- if(a.hr == 23)
- {
- a.hr = 0;
- }
- for(int j = 0; j<60; j++)
- {
- if(a.min == 59)
- {
- a.min = 0;
- }
- for(int k = 0; k<60; k++)
- {
- if(a.sec == 59)
- {
- a.sec = 0;
- }
- cout<<a.hr<<" : "<<a.min<<" : "<<a.sec<<endl;
- a.sec++;
- //sleep(1000);
- clrscr();
- }
- a.min++;
- }
- a.hr++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement