Created
June 25, 2017 12:16
-
-
Save Ambratolm/58b29fee950a0af513bc704ffe9e09c8 to your computer and use it in GitHub Desktop.
Ecrire l’algorithme qui cherche la plus grande valeur parmi trois nombres saisis par l’utilisateur.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
main() | |
{ | |
printf("--------------------------\n"); | |
printf("Max de 3 nombres\n"); | |
printf("--------------------------\n"); | |
printf("\n"); | |
float a,b,c, m,max; | |
printf("Entrez le premier nombre: "); | |
scanf("%f",&a); | |
printf("Entrez le deuxième nombre: "); | |
scanf("%f",&b); | |
printf("Entrez le troisième nombre: "); | |
scanf("%f",&c); | |
if (a > b) { | |
m = a ; | |
} else { | |
m = b ; | |
} | |
if (m > c) { | |
max = m ; | |
} else { | |
max = c ; | |
} | |
printf("\n"); | |
printf("\n"); | |
printf("Le Maximum est: %f", max); | |
printf("\n"); | |
printf("\n"); | |
system("pause"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment