what will be the output(step by step) for the following-
if t=10.
1) t-=++t+(--t)*2
2)t+=t-- + ++t+ --t
ans for each case
kvnmurty:
can you please rate the answer and i hope the step by step answer is clear.
Answers
Answered by
2
for 1) t = - 18 after the statement is executed
--t is done first. so t becomes 9. u get 18 to right of +. ++t gives 10. and on left of + we have 10. RHS of -= we have 28. t is now 10.
for 2) t = 38 after the statement is executed
--t is done first. so t=9. RHS =9. ++t is 10 and t become 10. RHS is now 19. t-- gives 10 value and t becomes now 9. RHS of += 29.
--t is done first. so t becomes 9. u get 18 to right of +. ++t gives 10. and on left of + we have 10. RHS of -= we have 28. t is now 10.
for 2) t = 38 after the statement is executed
--t is done first. so t=9. RHS =9. ++t is 10 and t become 10. RHS is now 19. t-- gives 10 value and t becomes now 9. RHS of += 29.
Answered by
0
Answer:
10,29 are answer friends
Similar questions
Math,
8 months ago
Computer Science,
8 months ago
Math,
1 year ago
Social Sciences,
1 year ago
English,
1 year ago
Math,
1 year ago