1
0
Fork 0
mirror of https://codeberg.org/DansLeRuSH/c-plus-plus-exercises.git synced 2024-12-03 15:42:12 +00:00

Display the time

This commit is contained in:
Franck ALBARET 2018-10-23 06:11:08 +00:00
parent 2bfab43c8f
commit 9364306655

40
EX12_afficher_heure.cpp Normal file
View file

@ -0,0 +1,40 @@
// Auteur : Franck ALBARET
#include <stdio.h>
void compteur (int hh, int mm, int ss)
{
ss=ss+1;
if (ss>59)
{
ss=0;
mm=mm+1;
}
else
{
ss=ss+1;
}
if (mm>59)
{
mm=0;
hh=hh+1;
}
else
{
mm=mm+1;
}
if (hh>23)
{
hh=0;
}
else
{
hh=hh+1;
}
printf ("L'heure actuelle est %02i:%02i:%02i\n",hh,mm,ss);
}
int main (void)
{
compteur (23,59,59);
return 0;
}