if a=1,b=0 b=a++ + ++a + ++a what is the final value of a and b? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

if a=1,b=0 b=a++ + ++a + ++a what is the final value of a and b?

30th Dec 2015, 11:05 AM
Deepanshu Gupta
Deepanshu Gupta - avatar
4 Answers
+ 2
b=8, a=4
3rd Jan 2016, 1:15 PM
Avinash More
+ 1
b = 1++ + ++2 + ++3 b = 1+3+4 b = 8. & a = 4
3rd Jul 2016, 10:35 AM
Kurapati Praveen
Kurapati Praveen - avatar
0
it would probably crash :D
15th Jun 2016, 12:56 PM
naghree
0
There is a rule that expalin that a variable can not be upadated twice in an expression. if such things happen the result depends upon the implementation of that specific compiler .
20th Jun 2016, 1:13 AM
Utpal Kumar
Utpal Kumar - avatar