0

What will be the answer?

a=3; b=2; b=a++; cout <<++b;

10th Nov 2016, 4:14 PM
tenzin norbu
tenzin norbu - avatar
6 Answers
+ 2
4 is the answer:-)
10th Nov 2016, 4:16 PM
Meet Turakhia
Meet Turakhia - avatar
+ 2
a+1 that is 4
10th Nov 2016, 5:04 PM
Aditya kumar pandey
Aditya kumar pandey - avatar
+ 1
why is it 4 and not 5?
11th Nov 2016, 3:25 AM
tenzin norbu
tenzin norbu - avatar
+ 1
dude you gotta understand first we have done b=a++ in which the value is first given to b then 1 is added ao the outcome is 3. then we have done cout<<++b in which first 1 is added and then printed so answer is 3+1=4 live a like if you understood:-)
11th Nov 2016, 3:29 AM
Meet Turakhia
Meet Turakhia - avatar
0
s0*
11th Nov 2016, 3:29 AM
Meet Turakhia
Meet Turakhia - avatar
0
4
11th Nov 2016, 7:03 AM
Jagrati Katariya
Jagrati Katariya - avatar