0
Why the output of below c# program is 4 not 5?
int x = 16; int y = 3; x %= y*2; Console.WriteLine(x++);
3 ответов
+ 8
third line: x = 16%6 = 4
fourth line: print x *and then* increment it by one
So in effect, x=4 is printed out and after that x=5 (but is no longer printed again)
+ 4
the output is 4, but if you want to get 5 replace x++ with ++x.
+ 1
Dang it @Kuba, you beat me to it! Good answer by the way!