Created
June 25, 2017 11:54
-
-
Save Ambratolm/4760c9bfaf136927f1506adc51ba08d3 to your computer and use it in GitHub Desktop.
Ecrire l’algorithme qui lit trois notes à partir du clavier, calcule et affiche la moyenne de ces notes. Enfin, il affiche la mention correspondante.
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("Calcul de la moyenne de trois notes et affichage de la mention\n"); | |
| float a,b,c, M; | |
| printf("Entrez la première note: "); | |
| scanf("%f", &a); | |
| printf("Entrez la deuxième note: "); | |
| scanf("%f", &b); | |
| printf("Entrez la troisième note: "); | |
| scanf("%f", &c); | |
| M=(a+b+c)/3; | |
| printf("Note moyenne: %.2f\nMentien: ",M); | |
| if (M>=12) | |
| printf("Bien\n"); | |
| if (M<12) | |
| { | |
| if (M>=10) | |
| printf("Passable\n"); | |
| if (M<10) | |
| printf("Non admis\n"); | |
| } | |
| printf("\n"); | |
| system("pause"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment