Advertisement
Doda94

Untitled

Dec 17th, 2023
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. void getMinMax(int *polje, int velicina, int *min, int *max){
  2.  
  3.     *min = polje[0];
  4.     *max = polje[0];
  5.  
  6.     for (int i = 0; i < velicina; i++){
  7.         if (polje[i] < *min) //polje[i] == *(polje + i)
  8.             *min = polje[i];
  9.         if (polje[i] > *max)
  10.             *max = polje[i];
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement