10个C语言选择题 求答案 求帮助!! 20

1.下面程序的输出结果是()。()#include<stdio.h>main(){intx=5,y=3;printf("%d\n",y=x/y);}A、0B、1C、3D、... 1.下面程序的输出结果是( )。()

#include <stdio.h>
main( )
{
int x=5,y=3;
printf("%d\n",y=x/y);
}
A、0
B、1
C、3
D、不确定的值

2.若变量已正确定义,下面程序段的输出结果是( )。()
x=5.238794;
printf("%f\n",(int)(x*1000+05)/(float)1000);
A、5.239000
B、输出格式说明与输出项不匹配,输出无定值
C、5.238000
D、5.24

3.以下程序的输出结果是( )。()
#include <stdio.h>
main( )
{
int a=4;
float b=9;
printf("a=%%d,b=%%f\n",a,b);
}
A、a=4,b=9.000000
B、a=%4,b=%9.000000
C、a=%%d,b=%%f
D、a=%d,b=%f

4.下面语句:()
printf("|%8.5f|\n",3461.45);
的输出结果是( )。
A、|61.45000|
B、|3461.450|
C、|3461.45000|
D、|3461.4500|

5.( )是不正确的C语言赋值语句。()
A、x=1,y=2;
B、x++;
C、x=y=5;
D、y=int(x);
6.与数学公式|cos(x)|等价的C语言表达式是( ),假定其中的x的单位是度数且不考虑π值的精度。()
A、sqrt(cos(x))
B、sqrt(abs(cos(x*3.14/180)))
C、sqrt(abs(cos(x*(/180)))
D、sqrt(fabs(cos(x*3.14/180)))
7.下面的程序( )。()
#include <stdio.h>
main( )
{
int x=3,y=0,z=0;
if(x=y+z)printf("* * * *");
else printf("# # # #");
}
A、有语法错误不能通过编译
B、输出* * * *
C、可以通过编译,但是不能通过连接,因而不能运行
D、输出# # # #

8.执行下面程序中的输出语句后,a的值是( )。()
#include <stdio.h>
main( )
{
int a;
printf("%d\n",(a=3*5,a*4,a+5));
}
A、65
B、20
C、15
D、10

9.若执行下面的程序时,从键盘上输入3和4,则输出结果是( )。()
#include <stdio.h>
main( )
{
int a,b,s;
scanf("%d%d",&a,&b);
s=a;
if(a<b)s=b;
s=s*s;
printf("%d\n",s);
}
A、14
B、16
C、18
D、20

10.以下程序不用第三个变量,实现将两个数进行对调的操作。请填空( )。()
#include <stdio.h>
main( )
{
int a,b;
scanf("%d%d",&a,&b);
printf("a=%d b=%d",a,b);
a=a+b;b=a-b;a=;
printf("a=%d b=%d\n",a,b);
}
A、a+b
B、a-b
C、b*a
D、a/b
展开
 我来答
小贼快快受死
2013-05-12 · TA获得超过281个赞
知道答主
回答量:59
采纳率:0%
帮助的人:23.4万
展开全部
1.下面程序的输出结果是( )。(b)

#include <stdio.h>
main( )
{
int x=5,y=3;
printf("%d\n",y=x/y);
}
A、0
B、1
C、3
D、不确定的值

2.若变量已正确定义,下面程序段的输出结果是( )。(a)
x=5.238794;
printf("%f\n",(int)(x*1000+05)/(float)1000);
A、5.239000
B、输出格式说明与输出项不匹配,输出无定值
C、5.238000
D、5.24

3.以下程序的输出结果是( )。(a)
#include <stdio.h>
main( )
{
int a=4;
float b=9;
printf("a=%%d,b=%%f\n",a,b);
}
A、a=4,b=9.000000
B、a=%4,b=%9.000000
C、a=%%d,b=%%f
D、a=%d,b=%f

4.下面语句:(c)
printf("|%8.5f|\n",3461.45);
的输出结果是( )。
A、|61.45000|
B、|3461.450|
C、|3461.45000|
D、|3461.4500|

5.( )是不正确的C语言赋值语句。(b)
A、x=1,y=2;
B、x++;
C、x=y=5;
D、y=int(x);
6.与数学公式|cos(x)|等价的C语言表达式是( ),假定其中的x的单位是度数且不考虑π值的精度。()
A、sqrt(cos(x))
B、sqrt(abs(cos(x*3.14/180)))
C、sqrt(abs(cos(x*(/180)))
D、sqrt(fabs(cos(x*3.14/180)))
7.下面的程序( )。(a)
#include <stdio.h>
main( )
{
int x=3,y=0,z=0;
if(x=y+z)printf("* * * *");
else printf("# # # #");
}
A、有语法错误不能通过编译
B、输出* * * *
C、可以通过编译,但是不能通过连接,因而不能运行
D、输出# # # #

8.执行下面程序中的输出语句后,a的值是( )。(a)
#include <stdio.h>
main( )
{
int a;
printf("%d\n",(a=3*5,a*4,a+5));
}
A、65
B、20
C、15
D、10

9.若执行下面的程序时,从键盘上输入3和4,则输出结果是( )。(b)
#include <stdio.h>
main( )
{
int a,b,s;
scanf("%d%d",&a,&b);
s=a;
if(a<b)s=b;
s=s*s;
printf("%d\n",s);
}
A、14
B、16
C、18
D、20

10.以下程序不用第三个变量,实现将两个数进行对调的操作。请填空( )。(b)
#include <stdio.h>
main( )
{
int a,b;
scanf("%d%d",&a,&b);
printf("a=%d b=%d",a,b);
a=a+b;b=a-b;a=;
printf("a=%d b=%d\n",a,b);
}
A、a+b
B、a-b
C、b*a
D、a/b
MarsCode
2024-08-21 广告
```c#include int main() { int a, b; printf("请输入两个整数: "); scanf("%d %d", &a, &b); int sum = a + b; printf(... 点击进入详情页
本回答由MarsCode提供
lizhiok
2013-05-14 · TA获得超过143个赞
知道答主
回答量:72
采纳率:0%
帮助的人:45.5万
展开全部
在开发环境里复制进去,运行一下,答案不就全出来了呀!
唉,现在的小孩真的是没救了.
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式