Guest User

Untitled

a guest
Nov 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void afficher (int *tableau , int tailleTableau );
  5. int sommeTableau(int tableau[] , int tailleTableau);
  6.  
  7. int main()
  8. {
  9. int tableau[3] = {10,20,30};
  10. afficher(tableau,3);
  11. sommeTableau(tableau,3);
  12. return 0;
  13. }
  14.  
  15. void afficher (int *tableau , int tailleTableau )
  16. {
  17. int i;
  18. for (i=0 ; i < tailleTableau ; i++)
  19. {
  20. printf("%d\n",tableau[i]);
  21. }
  22. }
  23.  
  24. int sommeTableau(int tableau[] , int tailleTableau)
  25. {
  26. int resultat;
  27. resultat = tableau[1] + tableau[2] + tableau[3];
  28. printf("la somme du tableau est %d\n", resultat);
  29. return resultat;
  30. }
Add Comment
Please, Sign In to add comment