C中表达式的执行逻辑是什么?

What is the execution logic of the expression in C?

假设我在 C 中有几个表达式。提供了不同的输出。

int i =2,j;
j= i + (2,3,4,5);
printf("%d %d", i,j);
//Output= 2 7

 j= i + 2,3,4,5;
 printf("%d %d", i,j);
 //Output 2 4

如何在带括号和不带括号的表达式中执行给出不同的输出。

Comma 运算符通过计算所有表达式并返回最后一个表达式来工作。

j= i + (2,3,4,5);

变成

j= i + (5); //j=7

在第二个表达式中,赋值运算符优先于逗号运算符,所以

j= i + 2,3,4,5;

变成

(j= i + 2),3,4,5; //j=4