Saudações galera!!!
Bom eu sou iniciante na programação e em especifico em c …
fiz um relogio com os conhecimentos que adquiri no decorrer do meu curso… mais percebi que o relogio esta atrasando…
desde ja agradeço a atenção
abraços!!!
#include <stdio.h>
#include <stdlib.h>
#include<conio.h>
/* run this program using the console pauser or add your own getch, system(“pause”) or input loop */
int main(int argc, char *argv[]) {
int s=0,m=0,h=0;
char acertar;
printf("Entre com a hora e PRESSIONE ENTER\n>>>");
scanf("%d",&h);
system("cls");
printf("Entre com os minutos e PRESSONE ENTER\n>>>");
scanf("%d",&m);
system("cls");
while(1){
system("color 13");
s++;
printf("***************************************************\n");
printf(" HORAS MINUTOS SEGUNDOS\n");
printf(" %d:%d:%d",h,m,s);
printf("\n***************************************************");
sleep(01);
system("cls");
if(s==59){
m++;
s=0;
}
if(m==59){
h++;
s=0;
m=0;
}
}
return 0;
}
