若a是float型变量,且a=6,则表达式“a/2+(int)(a+1)%2”的值为【 】。

admin2009-05-20  36

问题 若a是float型变量,且a=6,则表达式“a/2+(int)(a+1)%2”的值为【  】。

选项

答案4

解析 a/2的值为3,表达式(int)(a+1)%2的值为1,所以最后结果为4。
转载请注明原文地址:https://kaotiyun.com/show/vM5p777K
0

最新回复(0)