ecrire-un-algorithme-qui-permet-de-convertir-un-temps-donne-en-seconde-en-heure-minutes-et-en-secondes

by personne
1k views
EXO TP Algo langage C:

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 <stdio.h>

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);
}

				
			

Tu pourrais aussi aimer

Leave a Comment

3 comments

gain tiktok followers for free 25 février 2024 - 10h19

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.

Reply
2000 followers instagram 25 février 2024 - 16h03

Hurrah! At last I got a web site from where I can in fact take helpful facts regarding my
study and knowledge.

Reply
how long does it tske for shrooms to kick in 17 mars 2024 - 5h50

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.

Reply

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More