C#C
C#10mo ago
murns

Question

So I am learning to code C# I have a question.

int x = 5; while (x > 0) { Console.Write(x); x--; if (x == 2) { x = 5; } }

why would this equal
543543543543543543

opposed to
55555555555555555555555555555

I thought it would be "5555555555" as the console is writing before it minuses the integer
Was this page helpful?