All pastes #190283 Raw Edit

Anonyme

public c v1 · immutable
·published 2006-10-03 21:23 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>float max(float* tab, short int nbre_note);float moyenne(float* tab,short int nbre_note);float max_2_var(float var1,float var2);int main(void){  float note[20],moyen,maxi;  short int nbre_note,a,i;  printf("combien de note désirez vous entrer?\n");  scanf("%hd",&nbre_note);  rewind(stdin);    for (i=0;i<nbre_note;i++)  {      a=i+1;   printf("entrer la %hd valeur\n",a);   scanf("%f",&note[i]);   rewind(stdin);  }  moyen=moyenne(note,nbre_note);  maxi=max(note,nbre_note);  printf("la moyenne de vos valeur est de %f est le maximum est de %f\n",moyen,maxi);  system("PAUSE");  return 0;	}float moyenne(float* tab,short int nbre_note){               int i;               float somme=0;               for(i=0;i<nbre_note;i++)               {                   somme=somme+tab[i];               }               somme=somme/nbre_note;               return somme;}float max_2_var(float var1,float var2){      float res;            if(var1>var2)        {                   res=var1;        }      else        {                   res=var2;        }              return res;}                                       float max(float* tab,short int nbre_note){           int i;           float res=0;           for(i=0;i<nbre_note;i++)           {             res=max_2_var(res,tab[i]);           }           return res;}