+ 1
what is the output? public static void Main (String[] arg) { int a = 5; int b = 5; Console.WriteLine(++a + b++); }
17 Réponses
+ 6
11
+ 3
6+5=11
+ 3
It's 11.
Reason is that prefix(++a) first adds one to the value, and then does the mathematical operators. So a = 6. The postfix (b++) first does the mathematical operators first, and then adds one,so b = 5.
+ 2
11
+ 1
11
0
11
0
What is the right answer
0
right answer 11
0
what is the right answer
0
11 is the right answer
0
6+5 =11 , you can check last lesson's
0
11
0
12
0
11
- 1
equal to "(++5)+(5++)" = 6 + 6 = 12
- 2
12
- 2
I think it is 12 can anyone tell me it right or no