- 1

X = 5; x=x++ *2+3* --x;

8th Jul 2021, 4:35 AM
shivam sandhan
shivam sandhan - avatar
3 odpowiedzi
+ 2
shivam sandhan Here x++ is post increment which first assign value then increment counter. --x is post decrement which first decrement value by 1 then assign. So here x = x++ * 2 + 3 * --x; Here x++ will assign value then x will be increased by 1 so x will be 6 x = 5 * 2 + 3 * --x; As x was 6 so --x will be 5 So now x = 5 * 2 + 3 * 5 = 25
8th Jul 2021, 5:12 AM
A͢J
A͢J - avatar
+ 1
Welcome to SoloLearn forum! your thread appears to be spam in nature. Your thread will be reviewed by the moderation team and most likely will be marked for deletion. Here are some tips to make sure your question qualifies: - Post only programming-related QUESTIONS and ANSWERS; - SEARCH for similar QUESTIONS or ANSWERS before posting; - Include relevant TAGS; - Follow community RULES: https://www.sololearn.com/Content-Creation-Guidelines/ DO NOT - Post spam/advertisement; - Use inappropriate language. * Post general discussions and open-ended questions in your feed. https://www.sololearn.com/discuss/1316935/?ref=app
8th Jul 2021, 4:38 AM
Sharique Khan
Sharique Khan - avatar
0
That's undefined behavior, the result depends on the compiler
8th Jul 2021, 10:41 AM
Angelo
Angelo - avatar