02600C语言程序设计基础自考历年真题试题试卷电子版及复习资料:https://www.ddwk123.cn/archives/69299
2013年1月高等教育自学考试全国统一命题考试
C语言程序设计 试卷
(课程代码02600)
一、填空题(本大题共16空,每空1分,共16分)
请在每小题的空格中填上正确答案。错填、不填均无分。
1.C语言的注释符是_________。
2.C语言程序的无符号基本整型变量以_________表示。
3.单字符在C语言中要用_________括起来。字符是以_________码存放。
4.C语言程序以_________给出真值。
5.C语言程序强制退出循环的语句是_________。
6.C语言程序函数返回值的类型,服从_________的类型。
7.函数渊用时用数组名,作为函数参数,传人的是_________。
8.例如:m=max(a,max(b,c));这时函数调用的方式是_________。
9.C语言程序中,在函数外部声明的变量称为_________。
10.C语言程序中,数组名作为函数参数时,不进行值传送而进行_________传送。
11.取一个变量地址的运算符是_________。
12.指针p==0表明P是_________。
13.Int**P表示p为_________,该指针指向一个整型量。
14.表示结构成员的形式是:_________一>成员名。
15.普通文件是指_________的一个有序数据集。
二、单项选择题(本大题共10小题,每小题2分,共10分)
在每小题列出的四个备选项中只有一个是符合题目要求的,请将其代码填写在题后的括号内。错选、多选或未选均无分。
16.十进制数356转化为八进制数是 【 】
A.358 B.456 C.544 D.624
17.i=9,m=15求i、m的值。 【 】
A.3 B.6 C.9 D.15
18.int a[]=“ABC”占用的存储器是 【 】
A.3个字节 B.4个字节 C.5个字节 D.6个字节
19.char a=’\101’声明a中存放的是 【 】
A.\101 B.101 C.5 D.’A’
20.while(a)等价于 【 】
A.while(a=0) B.while(a==0) C.while(!a) D.while(a!=0)
21.int a=3,b=8,c=5,m;m=(a>b)?a:(b>c)?b:c;in的值为 【 】
A.3 B.5 C.8 D.13
22.有宏定义#define M(x)x*x*2;则a=M(2+3)的值是 【 】
A.2 B.3 C.11 D.14
23.有函数illI m(float x){floal 2;z=。;rehJrn(z);l用n=m(3 5);调用.则返回值是 【 】
A.3 B.3.5 C.4 D.实型值
24.有声明int a[]={8.2.5}、*p=a;则取值为2的是 【 】
A.p+1 B.*(a+1) C.*p++ D.a+l
25.在C语言程序中标准输入文件是指 【 】
A.键盘 B.磁盘 C.显示器 D.磁盘上的文件
三、写出程序执行的结果(本大题共10小题,每小题3分,共30分)
26.#include<stdio.h>
void main()
{
int a=3,b,c=5:
b=a+c:
printf(”a=%d,b=%d,c=%d\n”,a,b,c);
}
27.#include<stdio.h>
void main()
{
char c=’k’,
int i =1;j=2,k=3;
float x=3e+5,Y=0.85;
printf(“%d,%d\n”,i==5&&c&&(j=8),x+yi+j+k);
}
28.#indiludc<stdio.h>
void main()
int a,b,max;
printf(“\n input two numbers:”);
scanf(”%d%d”;&a,&b);
min=a;
if(min>b)min=b;
printf(“min=%d”,min);
}
29.#indiludc<stdio.h>
void main()
{
int a,b,c,max,min;
printf(“input three numbers:”);
scant'(“%d%d%d”,&a,&b,&c)
if(a>b)
{max=a;min=b;}
else
{max=b;min=a;}
if(max<c)
max=c;
else
if (min>c)
min=c
printf(“max=%d\nmin=%d”,max,min);
}
30.#include<stdio.h>
void main()
{
int a=0,n;
printf(“\n input n:”);
scanf(”%d”,&n);
while(n–)
printf(”%d”, n);
}
31.#include<stdio.h>
void main()
{
int i,a[10]
for (i=0;i<10;i++)
a[i]=3i+1;
printf(”%d”,a[5.8]);
}
32.#include<stdio.h>
void main()
{
int n;
printf(”input number\n”);
scanf(”%d”,&n);
s(n);
}
int s(int n)
{
int i;
for(i=n-1;i>=1;i–)
n=n+i;
printf(”n=%d\n”,n);
}
33.#include<stdio.h>
void main()
{
int a[5],i,*pa,h=0;
pa=a;
for(i=0;i<5;i++)
{
*pa=i;
pa++;
}
for(pa–;*pa>0;pa–)
printf(”%d”,*pa);
}
34.#include<stdio.h>
#include<string.h>
cpystr(char *pss)
{
char ch,*q;q=pss;
while(*++pss!=’\O’);
while(pss-q>0){ch=*–pss;putchar(ch);}
}
main()
{
chat*pa=”CHINA”,*pb:int n;
n=cpystr(pa);
}
35.#include<stdio.h>
void main()
{
FILE*fpl.*fp2;
char ch;
if((fpl=fopen(”cl.txt”,”rt”))==NULL)
{
printf(”Cannot open file strike any key exit!”);
exit(1);
}
if((fp2=fopen(”c2 txt”,”wt”))==NULL)
{
printf(”Cannot open file strike any key exit!”);
exil(1);
}
ch=fgete(fpl);
while(eh!=EOF)
{
fpute(ch.fp2);
ch=fgetc(fp1);
}
felose(fpl);
felose (fp2);
}
四、改错题(本大题有2处错,在错处画线1分,改正1分,多画不得分,本大题共4分)
36.该程序的功能是拷贝字符串。
#include”stdio.h”
strcopy(char*pss,chat*pds)
{
while(pds++=pss++);
}
main()
{
char a[10],b[10];
scanf(“%s”,a);
strcopy(a,b);
printf(string a=%s\nstring b=%s\n”,*a,*b);
}
五、编程题(本大题共3小题,每小题10分,共30分)
37.输人5个数,输出其中最大的数。
38.打印上三角形九九乘法表。如图:
1*1=1 1*2=2 1*3=3 1*4=4 1*5=5 1*6=6 1*7=7 1*8=8 1*9=9
2*2=4 2*3=6 2*4=8 2*5=10 2*6=12 2*7=14 2*8=16 2*9=18
3*3=9 3*4=12 3*5=15 3*6=18 3*7=21 3*8=24 3*9=27
4*4=16 4*5=20 4*6=24 4*7=28 4*8=32 4*9=36
5*5=25 5*6=30 5*7=35 5*8=40 5*9=45
6*6=36 6*7=42 6*8=48 6*9=54
7*7=49 7*8=56 7*9=63
8*8=64 8*9=72
9*9=81
请先
!