Expression evaluation incr – decr – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  

Login
[lwa]



Exam Questions-ICSE2017-03B #JAVA#7233    siteicon   siteicon  

Problem Statement - Expression evaluation incr – decr

What is the value of x1 if x=5?
x1= ++x – x++ + –x

Solution

TC++ #7233

x1=++x – x++ + –x
x1 = 6 (x is incremented to 6) – 6 (x is incremented to 7) + 6 (x is decremented to 6)
= 6


Share

CSKC| Created: 15-Apr-2019 | Updated: 27-Nov-2019|ICSE2017






Back