Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

The program fragment- int a=5,b=2 print (a++*++b)

Print 15 print 10 prints 18 none of the above
by

2 Answers

nerdkapilgupta
For A= 5 & B = 2 The term (a++*++b) will result in 15.
value of a will be taken as 5 and b=3 then they will be multiplied together.
As (a) is having post increment it will get incremented later.
As (b) is having pre increment it will get incremented first.
ganeshkavhar
Result will be 15

Login / Signup to Answer the Question.