Skip to content

Instantly share code, notes, and snippets.

@Ambratolm
Last active June 25, 2017 11:17
Show Gist options
  • Save Ambratolm/d7f7d1c8399a0bb984fe78d79f0aebfb to your computer and use it in GitHub Desktop.
Save Ambratolm/d7f7d1c8399a0bb984fe78d79f0aebfb to your computer and use it in GitHub Desktop.
Ecrire l’algorithme qui permet de lire 3 notes d’un étudiant et qui calcul et affiche la moyenne par la suite.
#include<stdio.h>
main()
{
printf("Moyenne de trois notes:\n");
printf("--------------------------------\n");
float a,b,c,M;
printf("Entrez la note 1: ");
scanf("%f",&a);
printf("Entrez la note 2: ");
scanf("%f",&b);
printf("Entrez la note 3: ");
scanf("%f",&c);
printf("--------------------------------\n");
M=(a+b+c)/3;
printf("La note moyenne est: %f\n", M);
printf("--------------------------------\n");
system("pause");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment