Advertisement
lineoff

FCTTEsts

Dec 14th, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include "stdio.h"
  2. #include "conio.h"
  3. int somme(int T[50],int N,int s){
  4.     int i;
  5.     s=0;
  6.     for(i=0;i<N;i++){
  7.         s=s+T[i];
  8.     }
  9.     return(s);
  10. }
  11. int main(void)
  12. {
  13.     int T[50];
  14.     int N;
  15.     int Ss;
  16.     int i;
  17.     printf("donner N: ");
  18.     scanf("%d",&N);
  19.     for(i=0;i<N;i++){
  20.         printf("donner l'élèment de l'indice %d: ",i+1);
  21.         scanf("%d",&T[i]);
  22.     }
  23.     printf("%d\n",somme(T,N,Ss));
  24.    
  25.     getch();
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement