Guest User

Untitled

a guest
Dec 11th, 2019
93
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int N;
  7. srand(time(NULL));
  8. printf("Podaj rozmiar tablicy\n");
  9. scanf("%d", &N);
  10. int *tab;
  11. tab = malloc(N*sizeof(int));
  12. for(int i =0; i<N; ++i)
  13. {
  14. tab[i]= rand()%21-10;
  15. }
  16. for(int i= 0; i<N; ++i)
  17. {
  18. printf("%d\n", tab[i]);
  19. }
  20. free(tab);
  21. tab=NULL;
  22. return 0;
  23. }
RAW Paste Data