/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
volatile int tf; // timer flag for 1 second
void number_output (int h, int m, int s)
{
printf("%02d:%02d:%02d\n",h,m,s);
}
int main(void)
{ int hr=20, min=0, sec=0; //set start time
while(1)
{ number_output (hr,min,sec);
tf = 1;
{ if (tf)
{ tf=0; sec++;
if (sec==60)
{ sec=0; min++;
if (min==60)
{ min=0; hr++;
if (hr==24) hr=0;
}
}
}
}
}
}