0

What is the output of the code?

int b=5; int a=++b; cout<<a+b ;

27th Aug 2017, 3:33 PM
rahul negi
rahul negi - avatar
5 Answers
+ 3
syntax error but once you fix that, its 12
27th Aug 2017, 4:08 PM
Jordan Chapman
Jordan Chapman - avatar
+ 3
😂😂 Syntex error
27th Aug 2017, 6:56 PM
Omar
Omar - avatar
+ 1
Error in Compilation!!
27th Aug 2017, 4:09 PM
GeekyShacklebolt
GeekyShacklebolt - avatar
+ 1
The answer is supposed to be 12 as it is a prefix operator,the value of b is incremented by 1 which is stored in a as well , so if should be 6+6=12
31st Aug 2017, 8:26 PM
sanghita saha
sanghita saha - avatar
0
see question is edited.
27th Aug 2017, 4:09 PM
rahul negi
rahul negi - avatar