main int xyz; x=0;y=z=-1; x+=-z---y;-z---y printfx=dnx;
The output of the program is:
x=1
Explanation:
First, the variables x, y, and z are initialized. x is set to 0, while y and z are both set to -1.
Next, the expression "-z---y" is evaluated. This expression is equivalent to "-(z--) - y". The "--" operator is the post-decrement operator, which means that the value of z is first used in the expression, and then decremented by 1. So, in this case, the value of z is used as -1, and then decremented to -2. Similarly, the value of y is -1. So, the expression evaluates to "-(-2) - (-1)", which is equal to 1.
The result of this expression is then added to x using the "+=" operator. So, x now becomes 1.
Finally, the value of x is printed using printf()
原文地址: https://www.cveoy.top/t/topic/gDKS 著作权归作者所有。请勿转载和采集!