Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void afficher (int *tableau , int tailleTableau );
- int sommeTableau(int tableau[] , int tailleTableau);
- int main()
- {
- int tableau[3] = {10,20,30};
- afficher(tableau,3);
- sommeTableau(tableau,3);
- return 0;
- }
- void afficher (int *tableau , int tailleTableau )
- {
- int i;
- for (i=0 ; i < tailleTableau ; i++)
- {
- printf("%d\n",tableau[i]);
- }
- }
- int sommeTableau(int tableau[] , int tailleTableau)
- {
- int resultat;
- resultat = tableau[1] + tableau[2] + tableau[3];
- printf("la somme du tableau est %d\n", resultat);
- return resultat;
- }
Add Comment
Please, Sign In to add comment