This is related to both operator precedence and the value returned by the comma operator.
You could easily look both of these up in which case you would be able to tell what the value of
l = (i=j,k);
l (assuming it is another int) is in this expression.
What most people forget is how the comma operator works, it has the syntax
<expression1>,<expression2>
but it returns the value <expression2>. Now at this point you are probably about to ask if it returns the value <expression2> then how can i = j in the statement
i=j,k;
surely i should equal k if the comma operator is returning <expression2>. However both = and , are operators so the order they get evaluated in in C is dependent on their relative precedence. Looking at an
operator precedence table you will quickly see that the comma operator has the lowest precedence of any operator, that is everything takes precedence over it which means that
i=j,k;
is evaluated as
(i=j),k;
which is why i = j following the statement. So coming back to my original question what is the value of l following
l = (i=j,k);
We know that i = j because of the relative operator precedence of = and , I have surrounded the expression in ( ) to force it to evaluate first (i.e. break the precedence order which is what ( and ) are for) l takes on the value of the expression
i=j,k
which we know is the second expression so l = k.
To be honest I have never come across what I would call a good use for the comma operator except in code obfuscation contests.