#include<stdio.h> #define MAN(x, y) ((x)>(y)) ? (x):(y); int main() { int i=10, j=5, k=0; k = MAN(++i, j++); printf("%d, %d, | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

#include<stdio.h> #define MAN(x, y) ((x)>(y)) ? (x):(y); int main() { int i=10, j=5, k=0; k = MAN(++i, j++); printf("%d, %d,

what is the output

21st Oct 2018, 6:20 PM
LYDIA JENNIFER P
LYDIA JENNIFER P - avatar
2 Answers
+ 1
12, 6, 12 Your code will be processed to: k = (++i) > (j++) ? (++i) : (j++); So 'i' will be incremented twice (during comparing and getting result). 'j' will be incremented once (during comparing)
21st Oct 2018, 6:35 PM
microBIG
microBIG - avatar
+ 1
What's the output? #include<stdio.h> #define MAN(x, y) ((x)>(y)) ? (x):(y); int main() { int i=10, j=5, k=0; k = MAN(++i, j++); printf("%d, %d, %d\n", i, j, k); return 0; }
21st Oct 2018, 6:21 PM
LYDIA JENNIFER P
LYDIA JENNIFER P - avatar