Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #define MINVAL(A,B)( A<B ? A : B )
- #define MAXVAL(A,B)( A>B ? A : B )
- int main (int argc, char **argv){
- int a = 1;
- int b = 2;
- printf("%d\n",MINVAL(a,b));
- printf("%d\n",MAXVAL(a,b));
- //int result = a++ < b++ ? a++ : b++;
- //int result = a++ > b++ ? a++ : b++;
- printf("%d\n",MINVAL(a++,b++));
- printf("%d\n",MAXVAL(a++,b++));
- return 0;
- }
- /*
- output:
- 1
- 2
- 2
- 4
- */
Advertisement
Add Comment
Please, Sign In to add comment