I was trying to create a clock program with c using the eclipse ide. When I run the program it keeps executing every single count. I used system("cls"). Also tried "clear" It shows no error but it is not working. I want the screen cleared after every count. It is showing a ⍰ symbol sometimes. https://i.stack.imgur.com/0ElDL.png ---This is what I got.
int main(void)
{
int hour,minute,second;
hour=minute=second=0;
setbuf(stdout,NULL);
while(1)
{
system("cls");
printf("%02d:%02d:%02d\n",hour,minute,second);
fflush(stdout);
second++;
if(second==60)
{
minute += 1;
second=0;
}
if(minute==60)
{
hour += 1;
minute=0;
}
if(hour==24)
{
hour=0;
minute=0;
second=0;
}
sleep(1);
}
return 0;
.