Advertisement
_takumi

min_max

Aug 6th, 2019
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. // CPP program to find maximum and minimum of
  2. // two numbers without using loop and any
  3. // condition.
  4. #include<bits/stdc++.h>
  5.  
  6. int main ()
  7. {
  8.    int a = 15, b = 20;
  9.    printf("max = %d\n", ((a + b) + abs(a - b)) / 2);
  10.    printf("min = %d", ((a + b) - abs(a - b)) / 2);
  11.    return 0;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement