0 votes 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 asked Jan 20, 2019 `JEET 331 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 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 See all 5 5 Comments reply `JEET commented Jan 20, 2019 reply Follow Share (2, 3) is evaluated to (2.3). How? 0 votes 0 votes kd..... commented Jan 20, 2019 reply Follow Share Its typo error I corrected 0 votes 0 votes `JEET commented Jan 20, 2019 reply Follow Share So you mean comma will find the greater value among the two. Is it? 0 votes 0 votes kd..... commented Jan 20, 2019 reply Follow Share https://www.geeksforgeeks.org/a-comma-operator-question/ 1 votes 1 votes `JEET commented Jan 20, 2019 reply Follow Share @kd.....Thanks! 0 votes 0 votes Please log in or register to add a comment.