inhuman_Arif

Max with pointer

Oct 12th, 2021
624
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int max(int *a,int *b)
  4. {
  5.     int mx;
  6.     if(*a>*b)
  7.         mx= *a;
  8.     else
  9.         mx= *b;
  10.     return mx;
  11. }
  12.  
  13. int main()
  14. {
  15.     int a,b;
  16.     scanf("%d %d",&a,&b);
  17.     printf("%d\n",max(&a,&b));
  18.  
  19.     return 0;
  20. }
RAW Paste Data