APP下载
首页
>
财会金融
>
c语言冲就完事了家人们
搜索
c语言冲就完事了家人们
题目内容
(
单选题
)
19.C语言中,系统默认局部变量为______。

A、  自动(auto)类型

B、  寄存器(register)类型

C、  静态(static)类型

D、  外部(extern)类型

答案:A

c语言冲就完事了家人们
25.在C语言中,若使用"r+"方式打开文件,以下选项中错误的是______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-5130-c044-ce3414c8e900.html
点击查看题目
9.以下程序段输出结果是______。
int x=023;
printf( );
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-dc00-c044-ce3414c8e901.html
点击查看题目
25.对文件操作的一般步骤是_______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-4f60-c044-ce3414c8e902.html
点击查看题目
10.下列程序段输出的结果是______。
int x=5;
if(x=4) printf( );
else printf( );
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-89f8-c044-ce3414c8e901.html
点击查看题目
17.下列程序段的运行结果是_______。
int i;
char s[5]={'\0','1','2','3','4'};
for(i=4;s[i]!='\0';i--)
printf( );
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-3da8-c044-ce3414c8e902.html
点击查看题目
22.已知:char b[6],*p=b;,则正确的赋值语句是____。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-f758-c044-ce3414c8e901.html
点击查看题目
5.设有int m=15,n;,则执行语句n=++m;后m、n的值分别为______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-d430-c044-ce3414c8e901.html
点击查看题目
24.设有:
typedef struct ST
{
long a;
int b;
char c[2];
}NEW;
则下面叙述中正确的是_______。
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-fb40-c044-ce3414c8e901.html
点击查看题目
14.执行以下程序段后,输出的结果是______。
int i,j;
for(i=1;i<=3;i++)
{
for(j=1;j<=5;j++)
if(j%2==0) break;
printf( );
}
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-91c8-c044-ce3414c8e901.html
点击查看题目
11.执行以下程序段后,输出的结果是______。
int x=2,y=0;
switch( )
{
case 2: x++;y=x+1;
case 1: y=y+1;break;
default:x++;y=y+1;
}
printf( );
https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fa-da30-c044-ce3414c8e902.html
点击查看题目
首页
>
财会金融
>
c语言冲就完事了家人们
题目内容
(
单选题
)
手机预览
c语言冲就完事了家人们

19.C语言中,系统默认局部变量为______。

A、  自动(auto)类型

B、  寄存器(register)类型

C、  静态(static)类型

D、  外部(extern)类型

答案:A

c语言冲就完事了家人们
相关题目
25.在C语言中,若使用"r+"方式打开文件,以下选项中错误的是______。

A.   文件必须存在

B.   可以进行读操作

C.   可以进行写操作

D.   只能进行读操作

解析:说明:销售金额 = 销售价格×销售数量
利润 = (销售价格-进货价格)×销售数量
参考程序:
#include
void main()
{
/*商品销售数量*/
int a[30]={96,28,31,20,25,21,29,37,47,94,38,85,93,26,56,42,25,44,78,26,37,82,39,66,55,42,27,41,18,96};
/*商品销售价格*/
double b[30]={3.5,4.5,5.6,2.3,3.3,8.4,4.5,2.4,2.0,4.6,3.18,3.4,4.6,2.8,4.8,9.7,2.4,3.4,4.3,3.7,5.4,6.5,10.4,12.5,24.6,33.18,31.4,5.6,8.8,9.8};
/*商品进货价格*/
double c[30]={3.2,4.1,5.2,1.6,2.3,7.4,4.1,1.2,1.1,3.6,2.52,2.3,3.2,2.1,3.2,8.4,1.2,2.2,3.1,3.3,4.5,5.2,8.3,10.0,20.5,28.1,25.2,4.5,7.2,7.5};
/*考生在此行下设计程序,不得删除本行*/
double total=0,profit=0;
int i;
for(i=0;i<30;i++)
{
total+=a[i]*b[i];
profit+=a[i]*(b[i]-c[i]);
}
printf("销售总额=%.2lf元,销售利润=%.2lf元\n",total,profit);
}
第六套

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-5130-c044-ce3414c8e900.html
点击查看答案
9.以下程序段输出结果是______。
int x=023;
printf( );

A.   19

B.   18

C.   23

D.   22

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-dc00-c044-ce3414c8e901.html
点击查看答案
25.对文件操作的一般步骤是_______。

A.   读写文件->打开文件->关闭文件

B.   读文件->写文件->关闭文件

C.   打开文件->操作文件->关闭文件

D.   操作文件->打开文件->关闭文件

解析:说明:(1) 要求使用循环实现;(2)输出结果形式为:
n=1234
参考程序一:
#include
void main()
{
/*考生在此行下设计程序,不得删除本行*/
int s=0,n=0;
while(s<=20202020)
{
n=n+1;
s+=2*n;
}
printf("n=%d\n",n);
}
综合应用题3:2020年新冠肺炎疫情期间,武汉某医院4月份每天治愈病人数存储在数组a中,计算并输出该院4月份累计治愈病人总数和每天治愈病人数的平均值(要求使用循环实现,平均值结果保留2位小数)。
参考程序:
#include
void main()
{
int a[30]={11,15,17,20,31,12,45,56,65,81,68,83,69,62,90,

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-4f60-c044-ce3414c8e902.html
点击查看答案
10.下列程序段输出的结果是______。
int x=5;
if(x=4) printf( );
else printf( );

A.   TRUEFALSE

B.   FALSETRUE

C.   TRUE

D.   FALSE

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-89f8-c044-ce3414c8e901.html
点击查看答案
17.下列程序段的运行结果是_______。
int i;
char s[5]={'\0','1','2','3','4'};
for(i=4;s[i]!='\0';i--)
printf( );

A.   1234

B.   01234

C.   4321

D.   43210

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fc-3da8-c044-ce3414c8e902.html
点击查看答案
22.已知:char b[6],*p=b;,则正确的赋值语句是____。

A.   b="abcde";

B.   *b="abcde";

C.   p="abcde";

D.   *p="abcde";

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-f758-c044-ce3414c8e901.html
点击查看答案
5.设有int m=15,n;,则执行语句n=++m;后m、n的值分别为______。

A.   15,15

B.   15,16

C.   16,15

D.   16,16

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-d430-c044-ce3414c8e901.html
点击查看答案
24.设有:
typedef struct ST
{
long a;
int b;
char c[2];
}NEW;
则下面叙述中正确的是_______。

A.   ST是一个结构体类型变量

B.   NEW是一个结构体类型

C.   NEW是一个结构体变量

D.   以上的说明形式非法

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-fb40-c044-ce3414c8e901.html
点击查看答案
14.执行以下程序段后,输出的结果是______。
int i,j;
for(i=1;i<=3;i++)
{
for(j=1;j<=5;j++)
if(j%2==0) break;
printf( );
}

A.   1 1 1

B.   2 2 2

C.   1 3 5

D.   2 4 6

https://www.shititong.cn/cha-kan/shiti/0005e1ce-a8fb-91c8-c044-ce3414c8e901.html
点击查看答案
11.执行以下程序段后,输出的结果是______。
int x=2,y=0;
switch( )
{
case 2: x++;y=x+1;
case 1: y=y+1;break;
default:x++;y=y+1;
}
printf( );

A.   3,5

B.   3,4

C.   2,0

D.   3,1

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