C#C
C#3y ago
exove

❔ Need help explaining precedence in C#

int x = 10;
int y = 20;
x += y += y = 5;
Console.WriteLine(x) //Output 35

Why is the above code does it evaluate to 35?
Why is it not
y = 5
y += y // 10
x += y // 20
Was this page helpful?