#include <stdio.h>
#include <stdlib.h>
#include <math.h>
void afficher(int tableau[], int taille){
for (int i=0; i<taille; i++){
printf("%d\n",tableau[i]);
}
}
void initialiser(int tableau[], int taille){
for (int i=0; i<taille; i++){
tableau[i]=0;
}
}
int somme(int tableau[], int taille){
int somme = 0;
for (int i=0; i<taille; i++){
somme += tableau[i];
}
return somme;
}
int max(int tableau[], int taille){
int maxi = tableau[0];
for (int i=0; i<taille; i++){
if (maxi<tableau[i])
maxi = tableau[i];
}
return maxi;
}
int main() {
int * tab = (int*) malloc(5*sizeof(int));
tab[0] = 1;
tab[1] = 2;
tab[2] = 3;
tab[3] = 4;
tab[4] = 257;
printf("%d",max(tab,5));
free(tab);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: