开发者

meaning of this code [closed]

开发者 https://www.devze.com 2023-01-13 09:41 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and开发者_StackOverflow社区cannot be reasonably answered in its curr
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and开发者_StackOverflow社区 cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.
int main()
{
 int x = 2, y = 6, z = 6;
 x = y == z;
 printf("%d", x);
}


== has higher precedence than =, and y==z is 1.

I will end the answer there, because this looks like homework.


http://codepad.org/fp4ZYJX5


The output is:

1                                 

Have a look at this, which explains a similar, yet more complex question and will answer yours as well.


Output is 1

If you want more help we can give you

0

精彩评论

暂无评论...
验证码 换一张
取 消