#include <stdio.h>
#include <stdlib.h>
#define ARRAY_SIZE 1000
void caracArray(int array[ARRAY_SIZE], int *pmin, int *pmax, float *pmoy) {
*pmin = array[0];
*pmax = array[0];
float somme = 0;
for (int i = 0; i < ARRAY_SIZE; i++) {
if (array[i] < *pmin) *pmin = array[i];
if (array[i] > *pmax) *pmax = array[i];
somme += array[i];
}
*pmoy = somme / ARRAY_SIZE;
}
int main() {
int tab[ARRAY_SIZE] = {3, 8, -2, 15, 7, 0, 0, 200, 10, 398, 12, 5, 9, 1, 1131, 525 ,846 , 5320, 4844,846 ,846 , 84};
int min, max;
float moy;
printf("Salut!\n");
caracArray(tab, &min, &max, &moy);
printf("Les valeurs min, max et moyenne sont : %d, %d, %f\n", min, max, moy);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: