0

x=5 y=x++ почему отсюда выходит что y=5,x=6???

15th Aug 2017, 11:59 AM
pro
pro - avatar
3 Answers
+ 10
x++ creates a copy of x, use it, and then increment the original x. In other words, x++ returns the original value of x before incrementing it. https://www.sololearn.com/Discuss/407846/?ref=app
15th Aug 2017, 12:03 PM
Hatsy Rei
Hatsy Rei - avatar
+ 1
x++ выполняется после y=x а если написать y=++x то будет x=6, y=6
15th Aug 2017, 12:14 PM
Yaroslav Pieskov
Yaroslav Pieskov - avatar
- 1
x++ --> the step you r doing this...there the value remains same... --> after that line it gets increased by 1 ++x -->the step you r doing this on that line it gets increased by value 1 eg: x=5 printf("%d",x++)--> 5 x=t printf("%d",++x)--> 6
15th Aug 2017, 3:06 PM
sayan chandra
sayan chandra - avatar