Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Ambratolm/4760c9bfaf136927f1506adc51ba08d3 to your computer and use it in GitHub Desktop.

Select an option

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.
#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