APP下载
首页
>
财会金融
>
c语言冲就完事了家人们
搜索
c语言冲就完事了家人们
题目内容
(
单选题
)
23.设有:
#define ADD( ) x+y
则语句
printf("s=%d", 5*ADD(4,3));
的输出结果是______。

A、  s=35

B、  s=12

C、  s=23

D、  s=17

答案:C

c语言冲就完事了家人们
8.判断char型变量ch是否为小写字母的正确表达式是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-2e08-c044-ce3414c8e901.html
点击查看题目
2.下列______是不合法的C语言常量。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-2250-c044-ce3414c8e901.html
点击查看题目
9.有定义:float x=3.345;,执行语句printf("%.2f\n",x);后,屏幕输出结果是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-83f8-c044-ce3414c8e901.html
点击查看题目
16.下列程序段的输出结果是_______。
int k,a[3][3]={1,2,3,4,5,6,7,8,9};
int s=0;
for(k=0;k<3;k++)
s=s+a[k][2-k];
printf( );
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-e5e8-c044-ce3414c8e901.html
点击查看题目
25.执行以下程序后,输出的结果是______。
#include
void main()
{
int a=2,b=3;
a=a^b;
b=a^b;
a=a^b;
printf( );
}
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-f970-c044-ce3414c8e900.html
点击查看题目
12.下面有关for循环的描述正确的是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-35d8-c044-ce3414c8e901.html
点击查看题目
16.设有定义:int a[][3]={1, 2, 3, 4, 5, 6, 7, 8};,则数组a的第1维长度是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-9398-c044-ce3414c8e900.html
点击查看题目
24.设有以下定义:
typedef struct student
{
int num;
char name[10];
float score;
}Stu;
Stu t;
则下面对结构变量成员引用正确的是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-a550-c044-ce3414c8e902.html
点击查看题目
13.设有定义:int i=0,s=0;,则循环语句while(s<20) {i++; s+=i;}中循环体执行的次数是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-39c0-c044-ce3414c8e900.html
点击查看题目
18.用户自定义的函数______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-9d80-c044-ce3414c8e900.html
点击查看题目
首页
>
财会金融
>
c语言冲就完事了家人们
题目内容
(
单选题
)
手机预览
c语言冲就完事了家人们

23.设有:
#define ADD( ) x+y
则语句
printf("s=%d", 5*ADD(4,3));
的输出结果是______。

A、  s=35

B、  s=12

C、  s=23

D、  s=17

答案:C

c语言冲就完事了家人们
相关题目
8.判断char型变量ch是否为小写字母的正确表达式是______。

A.   'a'<=ch<='z'

B.   ('a'<=ch)||(ch<= 'z')

C.   ('a'<=ch)&&(ch<='z')

D.   ('a'<=ch) and (ch<='z')

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-2e08-c044-ce3414c8e901.html
点击查看答案
2.下列______是不合法的C语言常量。

A.   'xabcde'

B.   "x1f"

C.   0x12

D.   2.1e3

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-2250-c044-ce3414c8e901.html
点击查看答案
9.有定义:float x=3.345;,执行语句printf("%.2f\n",x);后,屏幕输出结果是______。

A.   3.345

B.   3.345000

C.   3.34

D.   3.35

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-83f8-c044-ce3414c8e901.html
点击查看答案
16.下列程序段的输出结果是_______。
int k,a[3][3]={1,2,3,4,5,6,7,8,9};
int s=0;
for(k=0;k<3;k++)
s=s+a[k][2-k];
printf( );

A.   15

B.   6

C.   12

D.   45

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-e5e8-c044-ce3414c8e901.html
点击查看答案
25.执行以下程序后,输出的结果是______。
#include
void main()
{
int a=2,b=3;
a=a^b;
b=a^b;
a=a^b;
printf( );
}

A.   2,2

B.   2,3

C.   3,2

D.   3,3

解析:说明:(1) 要求使用循环实现;(2)输出结果保留5位小数,形式为:
PI=3.12345
#include
void main()
{
/*考生在此行下设计程序,不得删除本行*/


}
#include
void main()
{
/*考生在此行下设计程序,不得删除本行*/
double s=0;
long n,i;
int t=1;
printf("Enter n:");
scanf("%ld",&n);
for (i=1;i<=n;i++)
{
s+=t*1.0/(2*i-1);
t=-1*t;
}
printf("PI=%.5lf\n",4*s);
}
综合应用题3:快递小哥张师傅4月份的每天送件单数和行车里程(公里)分别保存在数组a和b中,其中数组元素-1表示该天休息,没有出工。
计算并输出4月份张师傅出工日每天平均送件单数和平均行车里程(要求使用循环实现,结果保留2位小数)。
输出格式为:
平均每天送件单数:123.45,平均每天行车里程:131.98 公里
参考程序:
#include
void main()
{
/*每天送件单数*/
int a[30]={-1,91,127,113,155,164,153,122,-1,-1,143,129,148,157,179,151,-1,167,185,188,192,184,137,-1,161,178,157,158,147,-1};
/*每天行车里程(公里)*/
int b[30]={-1,88,151,109,155,139,146,131,-1,-1,136,175,165,147,196,160,-1,146,128,135,153,178,141,-1,131,149,155,178,216,-1};
/*考生在此行下设计程序,不得删除本行*/
int i,n=0;
float count=0,dist=0;
for(i=0;i<30;i++)
{
if(a[i]!=-1)
{
count=count+a[i];
dist=dist+b[i];
n++;
}
}
printf("平均每天送件单数:%.2f,平均每天行车里程:%.2f 公里\n",count/n,dist/n);
}
第二套

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-f970-c044-ce3414c8e900.html
点击查看答案
12.下面有关for循环的描述正确的是______。

A.   for循环只能用于循环次数已经确定的情况

B.   for循环先执行循环体语句,后判断条件

C.   在for循环中不能用break语句跳出循环体

D.   for循环体中,可以包含多条语句

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-35d8-c044-ce3414c8e901.html
点击查看答案
16.设有定义:int a[][3]={1, 2, 3, 4, 5, 6, 7, 8};,则数组a的第1维长度是______。

A.  2

B.  3

C.  4

D.  8

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-9398-c044-ce3414c8e900.html
点击查看答案
24.设有以下定义:
typedef struct student
{
int num;
char name[10];
float score;
}Stu;
Stu t;
则下面对结构变量成员引用正确的是______。

A.   t.num

B.   Stu.num

C.   struct.name

D.   student.score

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-a550-c044-ce3414c8e902.html
点击查看答案
13.设有定义:int i=0,s=0;,则循环语句while(s<20) {i++; s+=i;}中循环体执行的次数是______。

A.   4

B.   5

C.   6

D.   7

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-39c0-c044-ce3414c8e900.html
点击查看答案
18.用户自定义的函数______。

A.   必须要有形参

B.   可以嵌套调用

C.   可以嵌套定义

D.   定义的位置一定位于调用位置的前面

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-9d80-c044-ce3414c8e900.html
点击查看答案
试题通小程序
试题通app下载