Posted By


chingongou on 12/01/14

Tagged


Statistics


Viewed 143 times
Favorited by 0 user(s)

Moyenne_NotMine


/ Published in: C
Save to your folder(s)

NotMine


Copy this code and paste it in your HTML
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. int main()
  4. {
  5. int i,n,compteur=0;
  6. float note,somme,moyenne;
  7. float notes[n];
  8. somme=0;
  9.  
  10. while (n>20)
  11. {
  12. printf("sasir le nombre de note :\n");
  13. scanf("%d",&n);
  14. }
  15.  
  16. for (i=1;i<=n;i++)
  17. {
  18. printf("saisie la note %d :\n",i);
  19. scanf("%f",&note);
  20. while (note<0 || note>20) {
  21. printf("erreur saisie la note %d :\n",i);
  22. scanf("%f",&note);
  23. }
  24. notes[i]=note;
  25. somme=somme+notes[i];
  26. }
  27. moyenne=somme/n;
  28. printf("la moyenne: %.2f\n",moyenne);
  29. for (i=0;i<=n;i++)
  30. {
  31. if (notes[i]>moyenne) compteur=compteur+1;
  32. }
  33. printf(" le nombre de note superieur du moyenne est %d",compteur);
  34. system("pause>null");
  35. return 0;
  36. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.