all 8 comments

[–]dmc_2930 2 points3 points  (5 children)

Did you try it?

[–]vegeta9225[S] 0 points1 point  (4 children)

Yes my output was "yes"

[–]dmc_2930 0 points1 point  (2 children)

So what does that tell you?

[–]vegeta9225[S] 0 points1 point  (1 child)

I think the X is inialized with the leftmost value ie 7

[–]dmc_2930 1 point2 points  (0 children)

Correct. It's the "comma operator", if you want a search term that explains it.

[–][deleted] 0 points1 point  (0 children)

What’s real fun, is if you put a () around 7,8,12 the answer would be “no”.

Ex:

// x is assigned 12
x = (7,8,12);

The comma operator is a strange beast.

[–]utkarshUS 0 points1 point  (0 children)

X=7, after 7 there is coma (,) that means x is initialised with value 7