Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- float nbNotes;
- int note;
- int i;
- float somme = 0.0;
- float moyenne = 0.0;
- int nbSuppDix = 0;
- printf("saisir le nombre de notes \n");
- scanf("%f",&nbNotes);
- for ( i = 0 ; i < nbNotes ; i++ )
- {
- scanf("%d",¬e);
- somme = somme + note;
- if( (note < 0) || (note > 20) )
- {
- printf("Erreur a la saisi \n");
- }
- if(note >= 10)
- {
- nbSuppDix++;
- }
- }
- if ( nbNotes == 0)
- {
- moyenne = 0;
- }
- else
- {
- moyenne = somme / nbNotes;
- }
- printf("La moyenne est %.2f \n",moyenne);
- printf("le nombre de note superieur a 10 est : %d \n",nbSuppDix);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement