Advertisement
Neo_Feo

Horor_CPP2_Done

Sep 17th, 2023
649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | Source Code | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int min (int *a, int size){
  5.     int m_min = a[0];
  6.     for(int i = 1; i< size;++i){
  7.         if(m_min < a[i])
  8.             continue;
  9.         m_min = a[i];
  10.     }
  11.     return m_min;
  12. }
  13. void swap(int * x,int * y){
  14.     int temp = *x;
  15.     *x = *y;
  16.     *y = temp;
  17. }
  18.  
  19. int main()
  20. {
  21.     int a[] = {1,2,3,4,-9,4,5,44};
  22.     int MIN = min(a,sizeof(a)/sizeof(int));
  23.     swap(&MIN,&a[0]);
  24.     printf("%i",a[0]);
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement