previous post
Ecrire un algorithme qui permet de convertir un temps donné en seconde, en heure, minutes et secondes. exemple : si temps = 3685 alors le programme affichera : 1h : 1min : 2s
#include
int main()
{
// déclaration des variables
//t= temps, h = heures, m = minutes, s = secondes, r = reste
int t, h, m, s, r;
//saisie du temps en seconde
printf("donner le temps en seconde");
scanf("%d",&t);
//conversion
r = t % 3600;
h = t / 3600;
m = r / 60;
s = m % 60;
//processus d'affichage de résultat après conversion
printf("l'heure est : %d\n", h);
printf("minutes est : %d\n", m);
printf("nombre de seconde est : %d\n", s);
}
3 comments
Aw, this was an exceptionally nice post. Finding the time and actual
effort to generate a great article… but what can I say…
I procrastinate a whole lot and never manage to get anything done.
Hurrah! At last I got a web site from where I can in fact take helpful facts regarding my
study and knowledge.
Hi there I am so happy I found your weblog, I really found you by accident, while I was looking on Digg for something
else, Nonetheless I am here now and would just like to say kudos for a remarkable post and a all round exciting blog (I also love the theme/design), I don’t have
time to read it all at the minute but I have book-marked it and also added your RSS feeds,
so when I have time I will be back to read a great deal more, Please do
keep up the superb b.