Guest User

Untitled

a guest
Jan 10th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <stdlib.h>
  4.  
  5. #define N 10
  6.  
  7. int main ()
  8. {
  9.  
  10.  
  11. int tab[N];
  12. int *w=tab;
  13. srand(time(NULL));
  14. int *i=tab;
  15. for(; i<tab+N; i++)
  16. {
  17. *i=rand()%101;
  18. printf(" %d adres %p \n", *i, i);
  19. if(*w<*i)
  20. {
  21. w=i;
  22. }
  23. }
  24. printf("Najwiekszy element jest rowny %d i ma adres %p \n", *w, w);
  25.  
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment