几道题不会做

答案我知道,但不懂怎么做的,请给出详解,谢谢!!!3.WhatisprintedoutbythefollowingCcodefragment?doublex=9/10;p... 答案我知道,但不懂怎么做的,请给出详解,谢谢!!!

3. What is printed out by the following C code fragment?
double x = 9/10;
printf("%f\n", x);
A. 0.000000 −
B. 0.900000
C. 1.000000
D. System dependent.
E. None of the above.

13. What is printed out by the following C code fragment?
int i = 10;
do {
--i;
} while (i--);
printf("%i\n", i);
A. -2
B. -1
C. 0
D. 1
E. None of the above.

7. What is printed out by the following C program fragment?
int a = -1, b = 999/1000, x = 1;
if (a / b > 5 || a)
--x;
else
x++;
printf("%d\n", x);
A. 0
B. 1
C. 2
D. A compilation error will occur.
E. A division-by-zero error will occur. −

5. What is printed out by the following C program fragment?
int i = 0, j = 1;
printf("%i\n", i != j ? i = j : i == j);
A. 0
B. 1 −
C. A non-zero value.
D. A compilation error occurs.
E. None of the above.
展开
 我来答
起阔4
2009-08-21 · TA获得超过247个赞
知道答主
回答量:77
采纳率:0%
帮助的人:0
展开全部
A: 9/10结果取整数为零,转化为浮点付给x,0.000000

E: while判断的表达式值为: 9, 7, 5...1, -1(0xFFFFFFFF), -3...死循环

E: 同第一题,b为0,抛出除零异常

B: i = j,表达式的值为赋值后i的值1.
豆恋凝爱0e
2009-08-21 · TA获得超过328个赞
知道小有建树答主
回答量:364
采纳率:0%
帮助的人:247万
展开全部
B D D B
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式