浙江科技学院2022年计算机C语言填空题大全(共六套)及答案 .pdfVIP

  • 0
  • 0
  • 约9.75千字
  • 约 11页
  • 2024-07-30 发布于河北
  • 举报

浙江科技学院2022年计算机C语言填空题大全(共六套)及答案 .pdf

floatfun(float)

main

{

nfloatx,y;

intflag;

printf(enterx:〃);

scanf(〃%f〃,x);

flag二fun(x);

if()printf(/x=%fisoutofrange.\n〃,x);

elseprintf(〃x=%f,y=%f\n〃,x,fun(x));

}

fun(floatx)

{

nfloats;

if(abs(x)1)return(2);

else

{

s=sqrt(l-x*x);

}

}

38、执行下列的程序段后,正确的结果是o

inti二5;

while(i=1)i一;

printf(〃%d〃,i);

39、以下程序的运行结果是o

main()

{

intk,a[4][4]=(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};

for(k-0;k4;k++)printf(〃%d,〃,a[k][k]);

}

40、以下程序在输入5,2之后的执行结果是o

#includestdio.h

voidmain()

{

ints,t,a,b;

scanf(〃%d,%d〃,a,b);

s=l;

t二1;

if(a0)s二s+1;

if(ab)t=s+t;

elseif(a==b)t二5;

elset二2*s;

printf(/s=%d,t=%d\n〃,s,t);

第39/49页

参考答案

一、填空题

1、1

2、*

3、5#五

4、[1]1[2]3

5、8

6、ascii码|补码

7、「36,]

8、0

9、循环

10、循环#重复

11、4

12、[1]2,1【2】地址传递对形参的改变能改变实参的值

13、内部#内

14、函数

15、[5p=(double*)malloc(sieof(double))?]

16、fgetcttfgetc()#getc#getc()

17、主函数(或main函数)。

18、return

19、全局变量

20、main函数

21、strupr#strupr()#strupr(字符串)

22、[5

#includestdio.h

(或

#include〃stdio.h〃)’]

23、0#零

24、1,5,9#1,5,9,#159

25、[1]j二1[2]k7

26、[bcdefgha,]

27、1

28、[abcde]

29、(n%2=0)

30、-1

31、1,-2

第40/49页

32、551

33、8,4

34、*t++

35、[*s]

36、3.141593,3.1416,3.142

37、[49,flag=二2,float,return(s)]

38、无限循环#死循环

39、1,6,11,16#1,6,11,16,#161116

40、s二2|t二3。

【解析】根据C语言“

文档评论(0)

1亿VIP精品文档

相关文档