Advertisement
Wojtekd

Funkcja zwraca mniejszą z liczb [Wskaźniki]

Dec 15th, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int mniejsza(int*, int*);
  4.  
  5. int main( void )
  6. {
  7.     int a = 5;
  8.     int b = 15;
  9.     printf("%d",mniejsza(&a,&b));
  10.     return 0;
  11. }
  12. int mniejsza(int* x, int* y)
  13. {
  14.     if(*x > *y)
  15.     {
  16.         return *y;
  17.     }
  18.     else
  19.     {
  20.         return *x;
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement