Advertisement
Kajoj

Std15.11.12_2

Nov 12th, 2015
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <time.h>
  3. #include <stdlib.h>
  4. #define N 10
  5.  
  6. void losuj(int *tab)
  7. {
  8.     srand (time(NULL));
  9.     for (int i=0; i<N; i++)
  10.     {
  11.         *(tab+(sizeof(int)+i))=rand()%10+1;
  12.     }
  13.  
  14. }
  15.  
  16. void wypisz(int *tab)
  17. {
  18.     for (int i=0; i<N; i++)
  19.     {
  20.         printf("%d\n",*(tab+(sizeof(int)+i)));
  21.     }
  22. }
  23.  
  24. int main()
  25. {
  26.     int tab[N];
  27.     int *t=&tab;
  28.     losuj(*t);
  29.     wypisz(*t);
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement