0 votes 0 votes Programming in C programming operator-precedence + – Vaishnavi01 asked Sep 3, 2018 • retagged Jun 26, 2019 by Cristine Vaishnavi01 546 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Vaishnavi01 commented Sep 3, 2018 reply Follow Share Output is 11 3 How it is calculated? 0 votes 0 votes Shiv Gaur commented Sep 3, 2018 reply Follow Share Refer https://www.geeksforgeeks.org/a-comma-operator-question/ 0 votes 0 votes Anurag Parothia 1 commented Sep 3, 2018 reply Follow Share simply go to comma operator wikipedia. You will get more examples there with nice explanation 0 votes 0 votes Please log in or register to add a comment.
Best answer 3 votes 3 votes x = (3, 2, 11); -------- Comma work as operator '()' operator has higher precedence than '='. So , firstly, bracket operator is evaluated. '()' operator is operated from left to right. but it is always the result of last that gets assigned. y = 3, 2, 11; -------- Comma work as seperator '=' operator has higher precedence than ',' operator. so 'y' gets initialized by '3'. '2' and '11' are just constant expression. so have no effect . Ref: https://stackoverflow.com/questions/17251584/difference-between-int-i-1-2-3-and-int-i-1-2-3-variable-declaration-with Ref:- https://www.geeksforgeeks.org/a-comma-operator-question/ Mizuki answered Sep 3, 2018 • edited Sep 3, 2018 by Shaik Masthan Mizuki comment Share Follow See all 2 Comments See all 2 2 Comments reply Shaik Masthan commented Sep 3, 2018 reply Follow Share @Mizuki, yes, your answer is correct, i just added some other reference 0 votes 0 votes Mizuki commented Sep 3, 2018 reply Follow Share @Shaik Masthan Thank you for edits. 0 votes 0 votes Please log in or register to add a comment.