c语言数组与函数答案,C语言数组与函数阶段测试题答案---(最新整理)

《C语言数组与函数阶段测试题答案---(最新整理)》由会员分享,可在线阅读,更多相关《C语言数组与函数阶段测试题答案---(最新整理)(8页珍藏版)》请在人人文库网上搜索。

1、C 语言数组与函数阶段测试题答案一、选择题(18*2=36 分)1、在定义“int a56;”后,第 11 个元素是【C】A、a25B、a24C、a14D、a152、假定 int 类型变量占用两个字节,其定义:int x10=0,2,4;,则数组 x 在内存中所占字节数是【D】。A、3B、6C、10D、203、当接受用输入的含空格的字符串地,应使用的函数是【B】A、scanf()B、gets()C、getchar()D、getc()4、设有数组定义:char array=”China”;。则数组 array 所占的空间为【C】A、4 个字节B、5 个字节C、6 个字节D、7 个字节5、设有变量。

2、定义:int a = 1,2,3,4;执行语句 a3 = - - a0? a1 + + : a2 + +;执行后,数组的元素 a0, a1, a2, a3的值依次为【D】A、 1,2,3,4B、 0,3,3,4C、 0,2,3,4D、0,2,4,36、以下程序的输出结果是【C】void main( )int i, x33 = 1,2,3,4,5,6,7,8,9for(i= 0;i f(in b, int n) int i, r;r=1;for(i=0; ivoid main ( )char str =SSWLIA,c; int k;for (k=1;(c=strk)!=0;k+)switch 。

3、(c)case I: +k; break ; case L: continue;default : putchar(c) ; continue ;putchar(*);程序运行后的输出结果是【SW*】2、#include void fun(int x,int y)x=x+y; y=x-y;x=x-y; printf(%d,%d,x,y);main()int x=2,y=3; fun(x,y);printf(%d,%dn,x,y);程序运行后的输出结果是【3,2,2,3 】3#include int a33=1,2,3,4,5,6,7,8,9,b10;main()f(b,a); printf(%。

4、dn,b0);f(int s,int p 3)s0=p11;程序运行后的输出结果是【5】4、fun(int a, int b)if(ab) return a;elsereturn b;main()int x=3,y=8,z=6,r; r=fun(fun(x,y),2*z);printf(%dn,r);程序运行后的输出结果是【12】5、#include int i=5;main()int i=3;int i=10; i+;f1(); i+=1;printf(%dn,i);int f1()i=i+1; return(i);程序运行后的输出结果是【4】6、int ff(int n)static in。

5、t f=1; f=f*n;returnf;main()int i; for(i=1;i main()int k=4,m=1,p;p=func(k,m); printf(%d,p);p=func(k,m);printf(%dn,p); func(int a,int b)static int m=0,i=2; i+=m+1;m=i+a+b;return (m);程序运行后的输出结果是三、程序填空(12*2.5=30)1 、下面程序求一个二维矩阵的最大值。# include #defineM3#defineN4intfindmax(inta N)int i, j, max = a00;for(i =。

6、 0; imax) max = aij;return (max); voidmain()int i, j, max,aMN; for(i = 0; i max)max=ai;c+;printf(%fn, (max1.0 * sum/c);“”“”At the end, Xiao Bian gives you a passage. Minand once said, people who learn to learn are very happy people. In every wonderful life, learning is an eternal theme. As a profess。

7、ional clerical and teaching position, I understand the importance of continuous learning, life is diligent, nothing can be gained, only continuous learning can achieve better self. Only by constantly learning and mastering the latest relevant knowledge, can employees from all walks of life keep up with the pace of enterprise development and innovate to meet the needs of the market. This document is also edited by my studio professionals, there may be errors in the document, if there are errors, please correct, thank you。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值