223 views

Output is 7.

But can someone justify, how?

#include <stdio.h>
int f(int a, int b) {
printf("%d", a + b);
return 0;
}
int main() {
f((2, 3), 4);
return 0;
}


When you do int a=(2,3) => a=(3) => a=3

comma evaluated first as it is in bracket which is 3 and then it is assigned to variable a

So 3+4 = 7 will be output
by

So you mean comma will find the greater value among the two. Is it?

@kd.....Thanks!

1
546 views