0

Please can someone explain to me why the output of this code is 10

int i = 4; int x = ++i+i++; Console.Write(x); //output = 10

9th Oct 2022, 12:11 PM
Mr Ajiero
Mr Ajiero - avatar
2 Answers
+ 3
++i; // 5 x = 5+5; Console.Write(x); // 10 i++; // 5 Console.Write(i); // 6
9th Oct 2022, 12:18 PM
Solo
Solo - avatar
+ 2
Thanks Solo ... I get it now
9th Oct 2022, 12:40 PM
Mr Ajiero
Mr Ajiero - avatar