if x=8, find the value of y, if y=x-(- -x* x++)+ (++x)*3
use computer increment and decrement operator way
Answers
Answered by
10
Given:
- x=8
To solve:
- y=x-(- -x* x++)+ (++x)*3
Solution:-
Always remember:-
- --x or ++x is called Prefix increment
- x++ or x-- is called Postfix increment
- Prefix increment first increase their values then moves forward.
- Postfix increment first move forward then the value gets increased.
- Here x is originally 8.
- --x * x++ So here the value of x first decreases due to --x which is multiplied with x++.
- x++ will have 7 but soon it reaches ++x(moves forward ) then it becomes 8
- ++x will first increase the value from 8 to 9 and then moves forward
- Calculating...
- you finally gets y=14
Similar questions
Social Sciences,
1 month ago
English,
1 month ago
History,
2 months ago
History,
2 months ago
Social Sciences,
9 months ago
Math,
9 months ago
Biology,
9 months ago