+ 1

what is the output? public static void Main (String[] arg) { int a = 5; int b = 5; Console.WriteLine(++a + b++); }

25th Jul 2016, 12:37 PM
Evan Sihab
Evan Sihab - avatar
17 Réponses
+ 6
11
25th Jul 2016, 1:52 PM
madhu sudhan
madhu sudhan - avatar
+ 3
6+5=11
26th Jul 2016, 4:00 AM
Pardeep kumar
Pardeep kumar - avatar
+ 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.
16th Aug 2016, 4:39 PM
Taj K.
+ 2
11
25th Jul 2016, 3:34 PM
Pratik Chaudhari
Pratik Chaudhari - avatar
+ 1
11
26th Jul 2016, 8:07 PM
Grzegorz Szczepanski
Grzegorz Szczepanski - avatar
0
11
31st Jul 2016, 6:19 PM
vaisakh
0
What is the right answer
9th Aug 2016, 2:01 PM
Rami Salim
Rami Salim - avatar
0
right answer 11
16th Aug 2016, 4:41 PM
Evan Sihab
Evan Sihab - avatar
0
what is the right answer
30th Sep 2016, 5:13 AM
venkat ramana
venkat ramana - avatar
0
11 is the right answer
16th Nov 2016, 8:20 AM
Bilal Ahmed
Bilal Ahmed - avatar
0
6+5 =11 , you can check last lesson's
19th Nov 2016, 2:58 PM
achraf
achraf - avatar
0
11
21st Nov 2016, 6:35 PM
Dilshad Ahmad
Dilshad Ahmad - avatar
0
12
13th May 2017, 5:24 PM
leichilngamba luwang
leichilngamba luwang - avatar
0
11
18th May 2017, 6:08 PM
Dilshad Ahmad
Dilshad Ahmad - avatar
- 1
equal to "(++5)+(5++)" = 6 + 6 = 12
10th Aug 2016, 9:12 PM
Sloan Wu
Sloan Wu - avatar
- 2
12
4th Aug 2016, 11:23 AM
Mahdi
Mahdi - avatar
- 2
I think it is 12 can anyone tell me it right or no
10th Aug 2016, 9:25 AM
Rami Salim
Rami Salim - avatar