2022年陕西省汉中市全国计算机等级考试C语言程序设计模拟考试(含答案).docx

2022年陕西省汉中市全国计算机等级考试C语言程序设计模拟考试(含答案).docx

2022年陕西省汉中市全国计算机等级考试C语言程序设计模拟考试(含答案) 学校:________ 班级:________ 姓名:________ 考号:________ 一、单选题(20题) 1.以下程序的输出结果是( )。 f(int b[],int m,int n) {int i,s=0; for(i=m;in;i=i+2)s=s+b[i]; return s; } void main() {int x,a[]={1,2,3,4,5,6,7,8,9}; x=f(a,3,7); printf(%d\n,x); } A.A.10? B.18? C.8? D.15 2.若有定义“char s1[100]=“name”, s2[50]=“address”, s3[ 80]=“person”;”,要将它们连接成新串“personnameaddress”,正确的函数调用语句是()。 A.strcat(strcat(s1, s2), s3);? B.strcat(s3, strcat(s1, s2);? C.strcat(s3, strcat(s2, s1);? D.strcat(strcat(s2, s1), s3);? 3. 下列程序的输出结果是( )。 main() { int a=4,b=5,c; if(a<B) { c=a*b;printf(%d,%d,%d\n,b,

文档评论(0)

1亿VIP精品文档

相关文档