Tchae

Untitled

Sep 19th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define size 10
  4.  
  5. int Saume(int t1[],int t2[]);
  6. void Aff(int t[]);
  7.  
  8. int tablo1[size], tablo2[size], i;
  9.  
  10. int main()
  11. {
  12.     for (i=0;i<size;i++)
  13.     {
  14.         tablo1[i]=rand()%50;
  15.         tablo2[i]=rand()%50;
  16.     }  
  17.     Aff(tablo1);
  18.     Aff(tablo2);
  19.     Saume(tablo1,tablo2);  
  20.     exit (EXIT_SUCCESS);
  21. }
  22.  
  23. void Aff(int t[])
  24. {
  25.     int j;
  26.     for (j=0;j<size;j++)
  27.         {
  28.             printf("%d\t", t[j]);
  29.         }
  30.         printf("\n");
  31. }
  32.  
  33. int Saume(int t1[],int t2[])
  34.     {
  35.         int tabres[size], j;
  36.         for (j=0;j<size;j++) tabres[j]=tablo1[j]+tablo2[j];
  37.         Aff(tabres);
  38.     }
Advertisement
Add Comment
Please, Sign In to add comment