0 0 votes 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; } Programming in C programming programming-in-c + – `JEET 857 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
0 0 votes 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 kd..... answered Jan 20, 2019 • edited Jan 20, 2019 by kd..... kd..... comment Share Follow See all 5 Comments 5 5 Comments reply Show 2 previous comments `JEET commented Jan 20, 2019 reply Follow flag So you mean comma will find the greater value among the two. Is it? 0 0 replyShare kd..... commented Jan 20, 2019 reply Follow flag https://www.geeksforgeeks.org/a-comma-operator-question/ 1 1 replyShare `JEET commented Jan 20, 2019 reply Follow flag @kd.....Thanks! 0 0 replyShare Please log in or register to add a comment.