0
Explain this?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Sample { class Program { static void Main(string[] args) { int x = 3; int y = x++; Console.WriteLine(x+" "+y); } } }
1 Resposta
0
When you put `++` at the end, `=` operand will be executed first.
Like this➡️ y = x; x += 1;
And if you put `++` at the front of `x`, `++` will be executed first , then the `=` operand.
Like this➡️ x += 1; y = x;
And your output will be `4 4`.