Computer Science, asked by parasmani89, 5 hours ago

What is the value of variable ans after evaluating
the following statement if ans = 200 initially:
ans = (ans >= 180) ? ans++ : ++ans;​

Answers

Answered by anindyaadhikari13
1

ANSWER.

  • The value of the variable 'ans' is 200.

EXPLANATION.

  • Here, the initial value of 'ans' is 200.
  • So, ans>=180 is true as 200>=180 is true.
  • So, ans = ans++ or ans = 200 (post-increment).
  • Therefore, the final value of 'ans' is 200.
Similar questions