2017年韩山师范学院本科插班生《C语言程序设计》试卷

合集下载

韩师C语言考试模板(含答案)

韩师C语言考试模板(含答案)

本学期数本的《C程序设计》的试卷命题情况如下:1、命题范围:第1章~第7章2、题型如下:(1)单项选择题(2)填空题(3)改错题(4)程序阅读题(5)程序完善题(6)编程题3、注意各个章节知识点的均衡。

题例一、单项选择题(每小题X分,总共X分)1.下列程序的运行结果是 C 。

#include <stdio.h>void main( ){ int i=1,j=1,k=2;if((j++‖k++)&&i++) printf("%d,%d,%d\n",i,j,k);}A、1,1,2B、2,2,1C、2,2,2D、2,2,3解析:选C,因为if((j++||k++)&&i++)中是两个逻辑运算,逻辑运算的执行是只要能判断其真假就行了,不一定要全部执行到,对于第一个逻辑运算&&,(两者都为真才为真,或其中一个表达式为假就为假)首先判断&&左端的表示式,若其为假则无需判断其右的表达式,若其为真则两边表达式都需判断,而&&左面表达式为真,所以&&右面表达式还需判断,所以i++是执行过的,再看(j++||k++),逻辑运算||,两端表达式其一为真就为真,两者为假才为假,由于||左表达式是真所以无需再判断其或的表达式,所以k++不执行,j++执行了。

综上应选C。

2.下列程序的运行结果是 C 。

#include <stdio.h>void main(){int x=5;if (x++>5) printf("%d\n",x);else printf("%d\n",x--);}A、4B、5C、6D、73.以下叙述中不正确的是____B_____A、用户定义的函数中可以没有return语句B、用户定义的函数中可以有多个return语句,以便可以调用一次返回多个函数值C、用户定义的函数中若没有return语句,则应当定义函数为void类型D、函数的return语句中可以没有表达式解析:B)用户定义的函数中可以有多个return语句是对的,执行到哪一个return语句,哪一个语句起作用。

C程序设计专接本校考试题及答案

C程序设计专接本校考试题及答案

《C++程序设计》校考试卷(12计算机信息管理)考试形式闭卷考试时间班级学号姓名成绩一.单项选择题(本大题共20小题,每小题2分,共40分)(1)C++源文件的扩展名是( A )(A)cpp (B)c (C)txt (D)exe(2)对于任意一个类,析构函数的个数最多为( B )(A)0 (B)1 (C)2 (D)3(3)使用下列哪个流格式控制符可设置转换基数为十六进制( C )(A)dec (B)oct (C)hex (D)endl(4)下列C++标点符号中表示一条语句结束的是( B )(A)# (B); (C)// (D){(5)下列选项中不是C++关键字的是( C )(A)bool (B)operator (C)intc (D)friend (6)类的私有成员可以在何处被访问( A )(A)本类的成员函数中(B)本类及子类的成员函数中(C)通过对象名在任何位置(D)不可访问(7)下面各项建立string类的对象实例不正确的方式是( D )(A)string str("OK");(B)string str="OK";(C)string str;(D)string str('OK');(8)假定A为一个类,则执行“A one(2), two[3];”语句时共调用该类构造函数的次数是( D )(A)1 (B)2 (C)3 (D)4(9)以下哪个成员函数表示是纯虚函数? ( C )(A)virtual void show(int)(B)void show(int) = 0(C)virtual void show()=0(D)virtual void show(int){}(10)C++源程序文件的扩展名为是( C )。

(A)c (B)cp (C)cpp (D)txt(11)下面关于友元函数描述正确的是( C )。

(A)友元函数是所在声明类的成员函数。

《C程序设计语言》样卷

《C程序设计语言》样卷

韩山师范学院2011年专升本插班生考试样卷计算机科学与技术专业高级语言程序设计试卷(A 卷)一、填空题(每空1分,共10分)1._______________________________ C程序的基本单位是。

2._______________________________________ C语言源程序文件的后缀是。

3._______________________________ C语言中的标识符由、口字母组成。

4._________________________________________________________________ 设y为float型变量,执行表达式y=6/5之后,y的值是 ________________________ 。

5._________________________________________________________________ 在C语言中,要求运算量必须是整型的运算符是___________________________ 。

6.如果函数值的类型与返回值的类型不一致时,应该以_____________ 准7.________________________________________________ 已知int a=8,*p=&a;,则*p 的值是________________________________________ 。

8._______________________________________________________________________ 把一些不同类型的数据作为一个整体来处理时,常用______________________ 。

9.______________________________________________ 若x=2,y=3,则x|y<<2的结果是。

专升本C语言程序设计专业考试试题

专升本C语言程序设计专业考试试题

专升本专业课考试《C语言程序设计》试题卷考生须知:1、考生姓名和准考证号码填写在答题纸密封线左边指定位置;2、考生一律在答题纸上答题,在本试题页上答题无效;3、答题不需要抄写题目,但必须写清题目编号(第几大题第几小题);4、试题、答题纸及草稿纸不准带出考场,离开考场须经监考人员清点;5、考试时间为150分钟;试题满分为150分;6、本试题共5页,5大题(注意反面)。

一.单项选择题(每题2分,共20分)1.对于一个正常运行和正常退出的C程序,以下叙述正确的是______。

A.程序从main函数第一条可执行语句开始执行,在main函数结束B.程序的执行总是从程序的第一个函数开始,在main函数结束C.程序的执行总是从main函数开始,在最后一个函数中结束D.从程序的第一个函数开始,在程序的最后一个函数中结束2.要使下面程序输出1, 2, 34,则从键盘输入的数据格式应为______。

#include <stdio.h>main(){char a,b;int c;scanf("%c%c%d",&a,&b,&c);printf("%c,%c,%d\n",a,b,c);}A.1 2 34 B.1, 2, 34 C.'1','2',34 D.12 343.对于以下程序片段,描述正确的是______。

int x=-1;do{x=x*x;}while(!x);A.是死循环B.循环执行两次C.循环执行一次D.有语法错误4.以下不能对二维数组a进行正确初始化的语句是______。

A.int a[2][3]={0}; B.int a[][3]={{1,2},{0}};C.int a[2][3]={{1,2},{3,4},{5,6}}; D.int a[][3]={1,2,3,4,5,6};5.以下程序运行后输出结果是______。

C语言程序设计本科C卷及答案

C语言程序设计本科C卷及答案

C语言程序设计本科C卷及答案This model paper was revised by the Standardization Office on December 10, 2020题号一二三四五六总分得分考试形式:■闭卷□开卷■笔试□机试答卷要求:试卷答案需填写至答题卡内一、单项选择题(每小题 2 分,共 30 分)1 2 3 4 5 6 7 8 9 10C D A B B A D A C C11 12 13 14 15C D A C B1、C语言源程序文件是一个后缀为( )的文件。

(第1章)A) .bas B) .java C) .c D) .pas2、下列哪个图形不属于传统流程图的符号( )(第2章)A) B) C) D)3、下列标识符中,不合法的用户标识符为()。

(第3章)A) a+4B) If C) then D) _1234、下面运算符优先级最高的是()。

(第3章)A) * B) !C) -(减号)D) =5、以下哪个是不正确的转义字符()。

(第3章)A) '\\' B) '077'C) '\0' D) '\n'6、若int n,x=1,y=0,则条件表达式n=x<yx:y的结果为()。

(第4章)A) 0 B) 1 C) 2 D) 表达式错误7、分析以下程序, 下列说法正确的是()。

(第4章)int main() { int i=10,m=0,n=0,k=0;switch(i/10){ case 0: m++;n++;break;case 10: n++; break;default: k++;n++; }printf("%d %d %d\n",m,n,k); }A) 0 0 0 B) 0 1 0 C) 1 1 0 D) 0 1 18、程序段如下:则以下说法中正确的是()。

(第5章)int k=-10; while(k<0) k=k+1;A) while循环执行10次B) while循环执行11次C) 循环体语句一次也不执行D) 循环是无限循环9、下列程序段执行后k值为()。

2017年韩山师范学院本科插班生考试试题《高级程序设计语言》A卷

2017年韩山师范学院本科插班生考试试题《高级程序设计语言》A卷

韩山师范学院2017年本科插班生考试试卷计算机科学与技术专业 高级语言程序设计试卷(A 卷)一、填空题(每空2分,共10分)1.C 程序的基本组成单位是 函数 。

2.当a=1,b=35,c=5时,表达式a!=b>c 的值是 _____ 0 __。

3. 一个C 文件是一个__字节流__流或二进制流。

4. 一个字符数据既可以以字符形式输出,也可以以_ 整形 _形式输出。

5. 若a 是int 型变量,且a 的初值为6,则执行表达式a+=a-=a*a 后,a 的值为 -24 。

二、单项选择题(每题2分,共30分)1.下述程序段的输出结果是(D)。

int x=10;int y=x--;printf("%d,%d",(y++,x),y++);A、9,10B、11,10C、10,9D、9,11逗号运算符:表达式用逗号分开,所以最终的值应该是最后一个表达式的值2.下面各选项中,均是C语言标识符的选项组是(C)。

A、for china toB、void union _342C、long_123 short56 _doD、text.txt _075 _3ew 3.若int k=10;则执行下列程序后,变量k的正确结果是(B)。

main( ){ int k=10;switch(k){ case 9: k+=1;case 10: k+=1;break;case 11: k+=1;default: k+=1}printf(″%d\n″,k);}A、12B、11C、10D、94.在位运算中,操作数每右移一位,其结果相当于(A)。

A、操作数除以2B、操作数乘以16C、操作数除以16D、操作数乘以2左移乘二,右移除以2,都是整除5.以下能对二维数组c进行正确的初始化的语句是(B)。

A、int c[][5]={{1},{},{4}};B、int c[][5]={{1},{2},{4}};C、int c[5][]={{2},{8},{4},{5}};D、int c[5][]={{6},{6},{9}};6、以下程序执行后,sum的值是(A)。

2017年韩山师范学院本科插班生《C语言程序的设计》试卷

2017年韩山师范学院本科插班生《C语言程序的设计》试卷

2017年韩山师范学院本科插班生考试试卷计算机科学与技术专业高级语言程序设计试卷(A卷)一、填空题(每空1分,共10分)1.一个C程序的执行是从本程序的函数开始。

2.结构化程序的三种基本结构为顺序结构、_________________、_________________。

3.能表示“整型变量x的绝对值小于5”的C语言表达式是________________ (不得使用系统函数)。

4.在C语言中,当表达式值为0时表示逻辑值“假”,当表达式值为________________时表示逻辑值“真”。

5.在位运算中,操作数每左移一位(无溢出),其结果相当于操作数____________以2。

6.设有定义FILE *fp; 则关闭fp对应文件的操作语句是。

7.在C程序中,根据数据的组织形式可以可分为___________文件和___________文件。

8.若有定义char s[]="\n123\\"; 则strlen(s)的值为_______;sizeof(s)的值为_______。

二、单项选择题(每小题1.5分,共30分)1.C语言中的标识符只能由字母、数字和下划线,且第一个字符( )。

A.必须为字母B.必须为下划线C.必须为字母或下划线D. 可以是字母或数字或下划线2.设a,b为整型变量,以下合法的表达式为( )。

A. b=a/2B. b=*a+2C. b+a=2D. b=a%2.53.以下选项中能表示合法常量的是A.整数:1,200B.实数:1.5E2.0C.字符斜杠:'\'D.字符串:"\007"4.若有a=4,b=3,c=5,则表达式a<b<c的值为( )。

A. 1B. 表达式不合法C. 0D. 25.下列关于指针变量赋空值的说法错误的是A.当赋空值的时候,变量指向地址为0的存储单元B.赋值语句可以表达为变量名=´\0´;C.赋值语句可以表达为变量名=0;D.一个指针变量可以被赋空值6.下列程序的运行结果是( )。

C语言程序设计试题及答案完整版

C语言程序设计试题及答案完整版

C语言复习资料5元必须清楚的:1)程序结构是三种: 顺序结构, 循环结构(三个循环结构), 选择结构(if 和switch)2)读程序都要从main()入口, 然后从最上面顺序往下读(碰到循环做循环,碰到选择做选择)。

3)计算机的数据在电脑中保存是以二进制的形式. 数据存放的位置就是他的地址.4)bit是位是指为0 或者1。

byte 是指字节, 一个字节= 八个位.5)一定要记住二进制如何划成十进制。

概念常考到的:1、编译预处理不是C语言的一部分,不再运行时间。

C语言编译的程序称为源程序,它以ASCII数值存放在文本文件中。

2、每个C语言程序中main函数是有且只有一个。

3、在函数中不可以再定义函数。

4、算法的是一定要有输出的,他可以没有输入。

5、break可用于循环结构和switch语句。

6、逗号运算符的级别最低。

第一章1)合法的用户标识符考查:合法的要求是由字母,数字,下划线组成。

有其它元素就错了。

并且第一个必须为字母或则是下划线。

第一个为数字就错了。

关键字不可以作为用户标识符号。

main define scanf printf 都不是关键字。

迷惑你的地方If是可以做为用户标识符。

因为If中的第一个字母大写了,所以不是关键字。

2)实型数据的合法形式:2.333e-1 就是合法的,且数据是2.333×10-1。

考试口诀:e前e后必有数,e后必为整数。

.3)字符数据的合法形式::'1' 是字符占一个字节,"1"是字符串占两个字节(含有一个结束符号)。

'0' 的ASCII数值表示为48,'a' 的ASCII数值是97,'A'的ASCII数值是65。

4)整型一般是两个字节, 字符型是一个字节,双精度一般是4个字节:考试时候一般会说,在16位编译系统,或者是32位系统。

碰到这种情况,不要去管,一样做题。

掌握整型一般是两个字节, 字符型是一个字节,双精度一般是4个字节就可以了。

C语言程序设计试题集及其答案完整版

C语言程序设计试题集及其答案完整版

C语言程序设计试题集及其答案HEN system office room 【HEN16H-HENS2AHENS8Q8-HENH1688】第一章基础知识一.填空1.每个C程序都必须有且仅有一个________ 函数。

2. C语言程序开发到执行通常要经过6个阶段即编辑、预处理、________、链接、加载和执行。

3. 软件是程序,以及______、使用和维护所需要的所有文档。

4. 国标中规定:“计算机程序是按照具体要求产生的适合于计算机处理的_________”。

5. 程序设计语言按照书写形式,以及思维方式的不同一般分为低级语言和________两大类。

6. C语言是由________组成的。

7. C语言的函数可分为主函数main、标准库函数和_________。

8. 一个函数是由两部分组成的,即:________和函数体。

9. 编译是将C语言所编写的源程序________成机器代码,也称为建立目标代码程序的过程。

10.程序是由某种程序设计语言编制出来,体现了编程者的控制思想和对计算机执行操作的要求。

不同的任务功能,就会需求不同的软件程序,如:控制计算机本身软硬件协调工作,并使其设备充分发挥效力,方便用户使用的系统软件程序,称为操作系统;而为办公自动化(OA)、管理信息系统(MIS)、人工智能、电子商务、网络互联等等应用而开发的软件程序,统称为_________。

11. 机器语言是以__________形式表示的机器基本指令的集合,是计算机系统唯一不需要翻译可以直接识别和执行的程序设计语言。

12. 与机器语言相比,使用汇编语言来编写程序可以用_______来表示指令的操作码和操作对象,也可以用标号和符号来代替地址、常量和变量。

13.在编译程序之前,凡以____开头的代码行都先由预处理程序预处理。

14. C程序的执行均是由执行_________开始。

15.函数体即为包含在{}内的部分。

它分为________和为完成功能任务由若干个C语句组成的执行部分。

C语言程序设计专升本测试卷

C语言程序设计专升本测试卷

C语言程序设计专升本测试卷(一)⏹题目包括三大部分, 单项选择题,判断题,编程题,请按要求在规定时间内作答。

⏹考试中途不能无端离场,否则视为放弃。

考试过程中如遇问题请及时向监考老师反馈。

一、单项选择题(每小题2 分,共 40分)1、在微机汉字系统中,一个汉字的机内码占的字节数是________。

A、1B、2C、4D、8【答案】B2、若int x=1,y=2,z=3 则表达式x<z?y:z的结果是________。

A、-1B、3C、2D、0【答案】C3、与十进制数245等值的二进制数是______。

A、11111110B、11101111C、11111011D、11101110【答案】A【解析】十进制向二进制的转换采用“除二取余”法,本题计算过程如下。

[*]4、若所用变量都已正确定义,则在以下选项中,非法的表达式是________。

A、a!=4||b==1B、'a'%3C、'a'=1/2D、'a'+32【答案】C【解析】选项C中的'a'是单字节它是不允许被赋值的。

所以选项C是非法的表达式。

选项A是逻辑表达式,是正确的。

选项B是字符'a'的值与3进行求余运算。

是正确的。

选项D参加运算的也是字符'a'的值,所以这个表达式也是正确的。

5、下面程序的输出结果是 __________.#include<stdio.h>void main( ){int x=3;do{printf("%d ",x-=2);}while(!(--x));}A、1B、1 -2C、3 0D、是死循环【答案】B6、对于代码 char c1[8];scanf("%s",c1);printf("\n%s",c1);在程序运行时,输入了"this pretty boy",则对应的运行输出显示结果是________。

2017年韩山师范学院本科插班生考试《基础英语》A卷

2017年韩山师范学院本科插班生考试《基础英语》A卷

韩山师范学院2017年本科插班生考试试卷英语专业基础英语试卷( A卷)nguage knowledge. Choose one word, phrase or statementthat best completes the sentence. (每空1分,共20分)1. Agriculture is the country’s chief source of wealth, wheat ______ by far the biggest cereal crop.A. isB. beenC. beD. being2. Jack _____ from home for two days now, and I am beginning to worry about his safety.A. has been missingB. has been missedC. had been missingD. was missed3. Above the trees are the hills, ____ magnificence the river faithfully reflects on the surface.A. whereB. of whoseC. whoseD. which4. Who ______ was coming to see me in my office this afternoon?A. you saidB. did you sayC. did you say thatD. you did say5. Does Alan like hamburgers?Yes. So much ____ that he eats them almost every day.A.forB. asC. toD. so6. Your ideas, ______ seem unusual to me.A. like herB. like hersC. similar to herD. similar to herself7. The opening ceremony is a great occasion. It is essential _____ for that.A. for us to be preparedB. that we are preparedC. of us to be preparedD. our being prepared8. Time _____, the celebration will be held as scheduled.A. permitB. permittingC. permittedD. permits9. The bus moved slowly in the thick fog. As a result, we arrived at our _____ almost two hours late.A. designationB. destinyC. destinationD. dignity10. He demonstrated his _____ for music by the ease with which he picked out melodies by ear.A. attitudeB. ability C aptitude D. wisdom11. Many modern language teachers make occasional use of teaching aids such as computers and tape recorders, but only a few use then systematically as an ______part of their work.A. incredibleB. individualC. integralD. associate12. Living in the countryside has its _____ as well as advantages.A. inferiorityB. setbacksC. drawbacksD. validity13. The air that holds a maximum amount of water vapor is _____, like s sponge unable to hold any more water.A. immersedB. saturatedC. quantifiedD. ventilated14. Electric wires in your house are_____ with poor conductors like rubber or silk.A. segregatedB. insulatedC. isolatedD. severed15. The enemy are now in a very difficult situation; they can neither advance nor ____ .A. resignB. retreatC. retrieveD. repel16. Reading is an active thinking process ______ the interaction between the reader and the print.A. containingB. indulgingC. involvingD. resolving17. In some cases, a sentence may be grammatically acceptable, but ______ in implication.A. ambitiousB. affirmativeC. approximateD. ambiguous18. For Europeans, life is a career; for Americans, it is a _______ of hazards.A. successB. recessionC. successionD. procession19. Reading efficiency means the ______ of a reading task within an appropriate time frame and with appropriate comprehension.A. accomplishmentB. commitmentC. contentmentD. complement20. In the past, major disasters, such as wars, plagues and earthquakes, could destroy only a _____ of the human race and environment.A. fractionB. fragmentC. frictionD. fictionII.Derivative. Write down the correct word to complete each sentence. (每题1分,共10分)A.Breathe1. It is so hot in this small kitchen that I can hardly ________.2. When I answered the telephone, there was an unknown and _____ voice on other end, which was really irritating.3. There was a ______ silence during the last world table-tennis championship game.4. You are wasting your ______ trying to persuade him to quit smoking. He’ll only stop when he wants to.5. During the last convention, there were so many items on the agenda that there was hardly any ____ space.B. express6. Being an advanced student of English, you should be able to _____ yourself freely in English.7. A cat’s mewing may be _______ of hunger, cold or pain.8. _______, impressionism and romanticism are different movements in art, music and literature.9. The shop assistant was a middle-aged man with an ______ face.10. The beauty of the cave, with its stalagmites and stalactites and dripping water, was beyond _______.III.Match each word in Column A with the phrase in Column B that is similar in meaning. (每题1分,共10分)IV.Fill in each blank with a preposition from the box.(每题1分,共10分)1. The “quality”newspapers are often held ___ as an example ofimpartial journalism.2. I don’t think our food suppliers will hold ___ much longer.3. Do you think the editors of the magazines will hold ____ our taking sides on political questions?4. During the enemy’s offensive, the village people refused to surrender but held ___ until the rescue troops arrived.5. The football match was held ____ till further notice on account of the continual rain.6. We are not surprised at the young man’s enrollment in that university because it is not their policy to hold a person’s past bad behavior _____ him.7. Any teacher is inclined to hold ___ any excellent work of the students for his or her class to imitate.8. If we think what we are doing is good and beneficial to the people we should try to hold ____ it and never give up.9. Before the rainy season, the authorities had already had the banks of earth built to hold _____ the potential flood.10. It was a place of romance. I felt I had just to hold ____ my hand to touch it.V.Reading comprehension. Choose the one that you think is the best answer and mark your answers on Answer Sheet.(每题2分,共10分)Passage OneToday, more and more people are using credit cards instead of money to buy the things they need. Almost anyone who has a steady income and a continuous work record can apply for a credit card. If you have a credit card, you can buy a car, have a dinner, take a trip, and even get a haircut by charging the cost to your account. In this way you canpay for purchases a month or two later, without any extra charge. Or you may choose to spread out your payments over several months and pay only part of the total amount each month. If you do this, the credit card company or the bank who sponsors the credit card will add a small service charge to you total bill. This is very convenient for the customer. With the credit card in your wallet or purse, you don’t have to carry much cash. This saves you trips to the bank to cash checks or draw cash. Also if you carry credit cards instead of a lot of cash, you don’t have to be concerned about losing your money through carelessness or theft. The card user only has to worry about paying the final bill. This of course can be a problem if you charge more than you can pay for.Credit cards are big business. Americans spend 16 billion dollars a year on credit cards and there are already 590 million of them in circulation. Many banks sponsor their own credit companies and issue cards free to their customers. Other credit card companies charge their members annual dues. The stores that accept credit cards must pay a small fee to the credit card company – a percentage of purchase price of the merchandise or service. In return, the credit card company promptly pay the store for the merchandise or service. Credit card companies make a profit from the fees they charge the stores and also from the fees collected from customers who pay for their charges in monthly installments.However, credit card companies sometimes have problems collecting overdue payments from unreliable customers. Also the use of stolen, lost, or counterfeit credit cards by criminals has become a big headache for the credit card companies which are responsible for the goods and services illegally charged to their customers’ account.1. What is the biggest worry for credit card users?A. Their credit cards may get stolen.B. They will be charged for the credit card service by the bank.C. The time allowed for them to pay back the money is not long enough.D. They may have spent more money than they can pay back.2. According to the passage, which of the following is Not a channel for the credit card company to make a profit?A. Membership fees for credit card users.B. A heavy fine for overdue payments.C. Service charges for stores that accept credit cards.D. Service charges for card users who pay back over period.3. The author’s purpose of writing this article is to _____.A. persuade people to use credit cardsB. warn people of the danger of using credit cardsC. explain how credit card business worksD. explain how to use credit cardsPassage TwoSome 2,400 miners were on the day shift last Tuesday morning at the Kinross gold mine, 65 miles from Johannesburg. A welding team was repairing a broken track for one of the trains that help carry gold ore to the surface. Suddenly, an acetylene tank sparked and flared. Flames swept through the tunnel, igniting plastic-covered wiring, which in turn set fire to polyurethane foam that keeps the walls dry and solid. Within minutes the mine shaft filled with thick black smoke containing toxic fumes from the burning plastic. Choking miners immediately fell and died of asphyxiation.When the initial 9 ½ -hour rescue operation ended, 177 were dead, one was missing, and 235 were injured, making Kinross the worst gold-mine disaster in South African history. All but five of the victims were black, and the black-dominated National Union of Mineworkers denounced the “unacceptably low safety standards” in the mines. In fact, Kinross last year lost its top safety rating. But the mine’s generalmanager said the plastics that burned had been considered safe. A government investigation is now under way.4. Which of the following statements is true?A. Many miners were burnt to death.B. Many miners choked and died.C. Many miners fell into the mine and were killed.5. Which of the following statements is not mentioned in the text?A. Kinross gold mine is the only gold mine in South Africa.B. Kinross gold mine disaster was worse than any other disaster that has taken place in South Africa.C. Kinross gold mine used to have a high safety rating.VI.Cloze. Decide which of the words given in the box below would best complete the passage if inserted in the corresponding blanks.The words can be used ONCE ONLY. Mark the letter for eachword on Answer Sheet.(每题1分,共10分)In the recent past, medical research has shown that heart disease is associated with certain factors in our day-to-day lives: with smoking, with poor nutrition, and with a lack of exercise.Doctors and other health experts have been 1____ the fact that we can often reduce the risk of heart disease by paying more attention to these factors.More and more people are realizing that there is a 2_____ betweenheart disease and the way they live. As a result of this new awareness, attitudes towards health are changing. In the past, people tend to think that it was 3____ for good health to have a good doctor who could be relied on to know exactly what to do when they become ill. Now they are realizing that merely receiving the best treatment 4_____ illness and injury is not enough. They are learning that they must 5____ more responsibility for their own health.Today many people are changing their dietary 6_____ and eating food with less fat and cholesterol. Many are paying more attention to reducing 7 ____ in their lives. The number of smokers in the US is now far below the level of a lot of years ago 8______ many people succeed in breaking the habit and as fewer people take it up.More and more are aware of the 9______ of regular exercise like walking, running or swimming, some have begun to walk or ride bicycles to work instead of driving. Millions have become members of health clubs and have 10 ____ health club one of the fastest growing businesses in the US today.e the words given in parentheses to translate the following sentences. Change the forms if necessary.(每题3分,共15分)1. 我们原无须自己预定雅虎因特网服务。

17级C语言程序设计试卷-附标准答案.doc

17级C语言程序设计试卷-附标准答案.doc

姓名:学号:A.p-1C. a-3.下面不是C语言合法的标识符。

A.M ainC. _int4.以下程序运行后输出的结果是________ - void main()(int a[ ]=( 1,2,3,4,5,6,7,8,9,0}, *p=a, i;for( i=0; i<10; i++ ) printf(H%d,二*(p+i)); }A.1,2,3,4,5,6,7,890,C. 0,1,2,3,4,5,6,7,895.C语言是由组成的。

A.语句C.函数6.若有定义int a=7; float x=2.5, y=4.7;,则表A. 2.500000B.a-1D. p—B._floatD. charB.2,3,4,5,6,7,8,9,10,1,D. 1,1,1,1,1,1,1,1,1,1,B.变量D. main函数式x+a%3*(int)(x+y)%2/4 的值为B. 2.750000xxxx 学院本科课程考试试卷(附标准答案)考试课程与试卷类型:C语言程序设计A 学年学期:201x-xxxx-xx考试时间:201x-x-xx一、单项选择题(从下列各题四个备选答案中选出一个正确答案,并将其代号写在答题纸相应位置处。

答案错选或未选者,该题不得分。

共10小题,每小题2分,共20分。

)L C语言属于语言。

A•机器 B.汇编C.面向过程D.面向对象2 .若已定义:int a[10]; *p=&a[2];,并在以后的语句中未改变p的值,不能表示a[l]地址的表达式是 ___________ OC.3.500000D. 0.0000007.判断char型变量m是否为大写字母的正确表达式是。

A. *A' <=m <=*Z'B. (m >=A) && (m <=Z)C.('A' >=m) || ('Z'v= m)D. (m >=*A') && (m v=Z)8.以下程序的输出结果是ovoid main()B. 1C.3int x=0.5; char z-a 1;printf(H %d\n u , (x&&l)&&(zv'z‘));A.OC. 2D. 3 9. 若有数组定义语句int a[4][5];,则对a 中数组元素的正确引用是A. a[41[l]B. a[2J]C. a[4][5]D. a[4-l][5-5] 10. 在max( max(l,2),3+4涵数调用中,含有 个实参。

C语言程序设计(专升本)试卷附答案

C语言程序设计(专升本)试卷附答案

C语言程序设计开/闭卷:闭专业测绘工程班级室主任签字:1、选择题(共50分,每题2分)1、以下叙述中正确的是A) C语言比其他语言高级B) C语言可以不用编译就能被计算机识别执行C) C语言以接近英语国家的自然语言和数学语言作为语言的表达形式D) C语言出现的最晚,具有其他语言的一切优点2、C语言中用于结构化程序设计的三种基本结构是A) 顺序结构、选择结构、循环结构B) if、switch、breakC) for、while、do-whileD) if、for、continue3、在一个C程序中A) main函数必须出现在所有函数之前B) main函数可以在任何地方出现C) main函数必须出现在所有函数之后D) main函数必须出现在固定位置4、下列叙述中正确的是A) C语言中既有逻辑类型也有集合类型B) C语言中没有逻辑类型但有集合类型C) C语言中有逻辑类型但没有集合类型D) C语言中既没有逻辑类型也没有集合类型5、下列关于C语言用户标识符的叙述中正确的是A)用户标识符中可以出现在下划线和中划线(减号)B)用户标识符中不可以出现中划线,但可以出现下划线C)用户标识符中可以出现下划线,但不可以放在用户标识符的开头D)用户标识符中可以出现在下划线和数字,它们都可以放在用户标识符的开头6、以下叙述中正确的是A)构成C程序的基本单位是函数B)可以在一个函数中定义另一个函数C)main()函数必须放在其他函数之前D)C函数定义的格式是K&R格式7、应用数据库的主要目的是A)解决数据保密问题B)解决数据完整性问题C)解决数据共享问题D)解决数据量大的问题8、一个C语言程序是由A)一个主程序和若干子程序组成B)函数组成C)若干过程组成D)若干子程序组成9、请选出可用作C语言用户标识符的是A)void,define,WORDB)a3_b3,_123,IFC)FOR,--abc,CaseD)2a,Do,Sizeof10、下列各数据类型不属于构造类型的是A)枚举型B)共用型C)结构型D)数组型11、在16位C编译系统上,若定义long a;,则能给a赋40000的正确语句是A)a=20000+20000;B)a=4000*10;C)a=30000+10000;D)a=4000L*10L12、以下不正确的叙述是A)在C程序中,逗号运算符的优先级最低B)在C程序中,APH和aph是两个不同的变量C)若a和b类型相同,在计算了赋值表达式a=b后b中的值将放入a中,而b中的值不变D)当从键盘输入数据时,对于整型变量只能输入整型数值,对于实型变量只能输入实型数值13、sizeof(float)是A)一个双精度型表达式B)一个整型表达式C)一种函数调用D)一个不合法的表达式14、若x,i,j和k都是int型变量,则计算表达式x=(i=4,j=16,k=32)后,x的值为A)4B)16C)32D)5215、设有定义:int n=0,*p=&n,**q=&p,则下列选项中正确的赋值语句是A)p=1;B)*q=2;C)q=p;D)*p=5;16、以下叙述中正确的是A)C程序的基本组成单位是语句 B)C程序中的每一行只能写一条语句C)简单C语句必须以分号结束 D)C语句必须在一行内写完17、计算机能直接执行的程序是A)源程序 B)目标程序 C)汇编程序 D)可执行程序18、以下关于宏的叙述中正确的是A)宏名必须用大写字母表示B)宏定义必须位于源程序中所有语句之前C)宏替换没有数据类型限制D)宏调用比函数调用耗费时间19、以下选项中正确的定义语句是A)double a;b; B) double a=b=7C)double a=7,b=7; D)double,a,b;20、以下不能正确表示代数式2ab/cd 的C语言表达式是A)2*a*b/c/d B)a*b/c/d*2C)a/c/d*b*2 D)2*a*b/c*d21、C源程序中不能表示的数制是A)二进制 B)八进制 C)十进制 D)十六进制22、检查软件产品是否符合需求定义的过程称为A)确认测试B)集成测试C)验证测试D)验收测试23、数据流图用于抽象描述一个软件的逻辑模型,数据流图由一些特定的图符构成。

《C语言程序设计》试题1(含答案)

《C语言程序设计》试题1(含答案)

《C语言程序设计》精品课件试题目录(按住CTRL键点击超链)单项选择题 (002)阅读程序题 (018)程序填空题 (039)编写程序题 (070)《C语言程序设计》精品课件制作小组2006年4月一、单项选择题导读:单项选择题要求从给出的四个备选答案中,选出一个最符合题意的答案。

本类习题主要检查对C语言基本概念的掌握情况,读者可根据学习进度选做部分习题。

在完成习题的过程中,不但要选出正确的答案,而且要清楚不正确的选项错在何处,以加深对概念的理解。

对于掌握不准的问题,应该通过上机实验来检验。

【1.1】以下不正确的C语言标识符是____。

A) int B) a_1_2 C) ab1exe D) _x【1.2】以下是正确的C语言标识符是____。

A) #define B) _123 C) %d D) \n【1.3】下列四组字符串中都可以用作C语言程序标识符的一组是。

••• A) print B) i\am C) Pxq D) str_l••• _3d one_half My->book Cpp••• oodbs tart$it line# pow••• aBc 3pai His.age while【1.4】下面各选项组中,均是C语言关键字的组是。

A) auto,enum,include B) switch,typedef,continueC) signed,union,scanf D) if,struct,type【1.5】下列不属于C语言关键字的是。

A) default B) register C) enum D) external【1.6】C语言程序从main()函数开始执行,所以这个函数要写在____。

A) 程序文件的开始B) 程序文件的最后C) 它所调用的函数的前面D) 程序文件的任何位置【1.7】下列关于C语言的叙述错误的是____A) 大写字母和小写字母的意义相同B) 不同类型的变量可以在一个表达式中C) 在赋值表达式中等号(=)左边的变量和右边的值可以是不同类型D) 同一个运算符号在不同的场合可以有不同的含义【1.8】在C语言中,错误的int类型的常数是。

C语言程序设计试题及答案

C语言程序设计试题及答案

《C语言程序设计》(卷)考核班级学生数印数考核方式闭卷考核时间120 分钟(本试卷包括第一卷和第二卷,答卷时间总共120分钟)第一卷第一部分:基础知识(20项,共40分)1.一个C语言程序是由()组成的。

A.主程序B.子程序C.函数D.过程2.转换说明符%x的输出形式是()。

A.十进制B.八进制C.十六进制D.二进制3.若a、b均为int型变量,且a=100,则关于循环语句for(b=100;a!=b;++a,++b) printf ( “------------“) ;的正确说法是()。

A.循环体只执行一次B.死循环C.循环体一次也不执行D.输出-----------4.若x、y、z均为int 型变量,则执行下列语句后的z值为()。

x=1; y=2; z=3; z=(x>y)?z :y ; z = (z<y)?z:x;A.1 B.4 C.2 D.35.下面标识符中,合法的用户标识符为()。

A.P#Ad B.12a C.char D._int6.‘A’+ 3 的结果是()。

A.’A’B.’D’的ASCⅡ码C.65 D.37.语句char str[20];说明str是一个字符串,最多能表示()。

A.20个字符B.19个字符C.18个字符D.21个字符8.将int 型变量n转换成float型变量的方法是()。

A.float n B.(float)n C.float(n) D.21个字符9.以下不正确的描述是()。

A.使用while和do-while循环时,循环变量初始化的操作应在循环语句之前完成B.while循环是先判断表达式后执行循环体语句C.do-while和for循环均是先执行循环体语句,后判断表达式D.for、while、do-while循环中的循环体均可以由空语句构成10.在循环中使用break 语句的功能是()。

A.使程序的执行跳出break所在的那一重循环B.使程序执行结束C.跳出包含此break语句的所有循环D.终止本次循环,继续下次循环11.下面是一个初始化指针的语句:int *px = &a;其中指针变量的名字应该是()。

韩山师范学院专插本《C语言程序设计》样卷

韩山师范学院专插本《C语言程序设计》样卷

韩山师范学院2011年本科插班生考试样卷教育技术学专业C语言程序设计1. C语言的数据类型中,构造类型包括:数组、 _______________ 和 ____________2. 在C程序中,指针变量能够赋________________ 值或______________ 值。

3. C目标程序经_________________ 后生成扩展名为exe的可执行程序文件。

4. 设有定义语句static char s[5」贝U s[4]的值是 _____________________ 。

5. 设x为int型变量。

与逻辑表达式!x等价的关系表达式是 _________________ 。

6. 若一全局变量只允许本程序文件中的函数使用,则该变量需要使用的存储类别是7. 磁盘文件按文件读写方式分类可以为顺序存取文件和 __________________ 。

8. 设有下列结构体变量xx的定义,则表达式sizeof(xx)的值是__________ 。

struct{ long num;char n ame[20];union {float y; short z;} yz;} xx;1. 设有定义int x=8, y,乙则执行y=z=x++, x=y= =z;语句后,变量x值是(A、0 B 1C、8D、92. 有以下程序mai n(){ in t i=1,j=1,k=2;if((j++ k++)&&i++)执行后输出结果是(A、1,1,2 B 2,2,1 C、2,2,2 D、2,2,33. 已知i、j、k为int型变量,若从键盘输入:1, 2, 3<回车〉,使i的值为1、j的值为2、k的值为3,以下选项中正确的输入语句是()A、scanf( %2d%2d%2d",&i,&j,&k);B、scanf( %d %d %d',&i,&j,&k);C 、 scanf( “%d,%d,%d ”,&i,&j,&k);D 、 scanf( “i=%d,j=%d,k=%d ”,&i,&j,&k); 4. 有以下程序main(){ int a=5,b=4,c=3,d=2;if(a>b>c) printf("%d\n",d);else if((c-1>=d)= =1) printf("%d\n",d+1);main() { intaa[4][4]={{1,2,3,4},{5,6,7,8},{3,9,10,2},{4,2,9,6}}; int i,s=0; for(i=0;i<4;i++) s+=aa[i][1]; printf( “%d\n ”,s);}程序运行后的输出结果是 ( ) A 、11 B 、 19 C 、 138. 以下程序的输出结果是 ( )main(){printf("\"%s\"\n",ch[1]);}A 、"AAAA"B 、 "BBB"9. 有以下程序 #define f(x) x*x main( ) { int i;i=f(4+4)/f(2+2); printf( “n%”d,i); } 执行后输出结果是 ( A 、 28B 、 2210. 决定 C 语言中函数返回值类型的是5. 6. 7.else printf("%d\n",d+2); } 执行后输出结果是 A 、2 以下程序段 ( x=1; do { x=x*x;} while (!x); A 、 是死循环 C 、 循环执行一次B 、3C 、D 、 编译时有错,无结果循环执行二次 有语法错误 ( ) B 、 int a[][2]={1,2,3,4};B、 D 、 以下不能正确定义二维数组的选项是 A 、 int a[2][2]={{1},{2}}; C 、 int a[2][2]={{1},2,3}; 有以下程序 D 、 int a[2][]={{1,2},{3,4}};D 、20char ch[3][5]={"AAAA","BBB","CC"};C 、 "BBBCC"D 、"CC")C 、16D 、4( )。

【标准答案】C语言程序设计-2017年秋季学期本科期末考试真题-2018年1月-国家开放大学

【标准答案】C语言程序设计-2017年秋季学期本科期末考试真题-2018年1月-国家开放大学

printf( "y= %d\n" ,y);
3 1.执行下面程序的输出结果为(
)。
** include<stdio. h>
void main () {
inti=O , s=O;
while(s<30) {i +=2; s+=i 祷 i; }
printf("s= %d\n" ,s) ;
32. 执行下面程序的输出结果为(
17. 表达式 (float)25/4 的值为 6 0 (
)
18. 已知 x= 一 25 ,则 fabs(x) 的值为一 25.0 0 (
)
19. while 循环是先判断循环条件,当条件为真时执行循环体。(
)
20. 在一维数组的定义语句中,数组名后带有一对中括号。(
)
2 1.字符串允许为空,并且其长度为 0 0 (
)
27. 在结构成员访问运算符中,点运算符和箭头运算符的左边均为结构指针变量。(
)
28. 在一个磁盘数据文件的文件名中,文件主名是必须的,扩展名可任选使用。)
29. 对二进制文件进行读和写操作将使用不同的系统函数。(
)
三、程序填空题(分析程序后把合适的内容填写在括号肉。每小题 6 分,共 30 分)
30. 执行下面程序的输出结果为)。
# include<stdio. h>
void mainO { int x=5 ,y=O; switch(2 铃 x-3) { case 4: y+ = x; break; case 7: y 十 =2 铃 x+1; break; 729
case 10: y+=3 铃 x; break;
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

2017年韩山师范学院本科插班生考试试卷计算机科学与技术专业高级语言程序设计试卷(A卷)一、填空题(每空1分,共10分)1.一个C程序的执行是从本程序的函数开始。

2.结构化程序的三种基本结构为顺序结构、_________________、_________________。

3.能表示“整型变量x的绝对值小于5”的C语言表达式是________________ (不得使用系统函数)。

4.在C语言中,当表达式值为0时表示逻辑值“假”,当表达式值为________________时表示逻辑值“真”。

5.在位运算中,操作数每左移一位(无溢出),其结果相当于操作数____________以2。

6.设有定义FILE *fp; 则关闭fp对应文件的操作语句是。

7.在C程序中,根据数据的组织形式可以可分为___________文件和___________文件。

8.若有定义char s[]="\n123\\"; 则strlen(s)的值为_______;sizeof(s) 的值为_______。

二、单项选择题(每小题1.5分,共30分)1.C语言中的标识符只能由字母、数字和下划线,且第一个字符( )。

A.必须为字母 B.必须为下划线C.必须为字母或下划线D. 可以是字母或数字或下划线2.设a,b为整型变量,以下合法的表达式为( )。

A. b=a/2B. b=*a+2C. b+a=2D. b=a%2.53.以下选项中能表示合法常量的是A.整数:1,200B.实数:1.5E2.0C.字符斜杠:'\'D.字符串:"\007"4.若有a=4,b=3,c=5,则表达式a<b<c的值为( )。

A. 1B. 表达式不合法C. 0D. 25.下列关于指针变量赋空值的说法错误的是A.当赋空值的时候,变量指向地址为0的存储单元B.赋值语句可以表达为变量名=´\0´;C.赋值语句可以表达为变量名=0;D.一个指针变量可以被赋空值6.下列程序的运行结果是( )。

#include <stdio.h>void main( ){ int i=1,j=1,k=2;if((j++‖k++)&&i++) printf("%d,%d,%d\n",i,j,k);}A.1,1,2 B.2,2,1 C.2,2,2 D.2,2,37.下列不会构成无限循环的语句或语句组是( )。

A.n=0; B. n=0;do {++n; } while(n<=0); while(1) {n++; }C.n=l0; D.for(n=0, i=l; ; i++) n+=i; while(n); {n--; }8.若要定义一个具有5个元素的整型数组,以下错误的定义语句是( )。

A.int a[5]=﹛0﹜;B.int b[]={0,0,0,0,0};C.int c[2+3];D.int i=5,d[i];9.有以下程序main(){ int a[4][4]={{1,2,3,4},{5,6,7,8},{3,9,10,2},{4,2,9,6}};int i,s=0;for(i=0;i<4;i++) s+=a[i][1];printf(“%d\n”,s);} 程序运行后的输出结果是( )。

A.11 B.19 C.13 D.2010.表达式a+=a-=a=9的值是A.9 B.-9 C.18 D.011.设i是int型变量,f是float型变量,用下面的语句给这两个变量输入值:scanf(“i=%d,f=%f”,&i,&f);为了把100和765.12分别赋给i和f,则正确的输入为( )。

A. 100 765.12B. i=100,f=765.12C. 100,765.12D. x=100 y=765.1212.若有宏定义#define s(m,n) m/n 则s(4+2,2+1)的值为( )。

A. 2B.7C. 6D. 313.若有以下程序段:int x=1,y=2;x=x^y;y=y^x;x=x^y;则执行上述语句序列后,x,y的值分别是( )。

A.X=2,Y=1 B.X=1,Y=2 C.X=2,Y=2 D.X=1,Y=114.若有以下说明和语句:struct student{ int age ; int num ; }std ,*p ; p =&std ;则以下对结构体变量std 中成员age 的引用方式不正确的是( )。

A .std.age B . p->age C .(*p).age D . *p.age 15.语句while(!E);中的表达式!E 等价于( )。

A .E ==0B . E!=lC . E!=0D .E ==116.若变量已正确定义,语句“if(a>b) k=0; else k=1;”和( )等价。

A .k=(a>b)?1:0; B .k=a>b; C .k=a<=b; D .a<=b ? 0 : 1; 17.若有以下定义,则对a 数组元素的正确引用是( )。

int a[5],*p=a ;A. *&a[5]B. a+2C. *(p+5)D. *(p+2)18.有如下语句 int a=10,b=20,*p1,*p2; p1=&a; p2=&b;如图1所示; 若要实现图2所示的存储结构,可选用的赋值语句是( )。

A. *p1= *p2;B. p1=p2;C. p1= *p2;D. *p1=p2;19.下面程序的运行结果是( )。

#include “stdio.h ” void main( ) { int j ,i ,k=0; for (j=50;j<=60;j++){ if (!( k%10))printf(“\n ”); for (i=2;i<j ;i++)if(!(j%i))break ;p1a p2bp1a p2b图1图2if(i>=j-1){ printf(“%d”,j);k++;}}}A.5359 B.5953 C.3595 D.953520.以下可作为函数fopen中第一个参数的正确格式是( )。

A.a:user\files.tet B. a:\user\files.tetC.“a:\user\files.tet” D. a:\ \user\files.tet三、阅读程序,将运行结果写到各题右侧的空白处(每小题4分,共20分)1.int x=1,y=0;switch(x){case 1:switch(y){case 0:printf(“##1##\n”);break;case 1:printf(“**2**\n”);break;}case 2:printf(“$$3$$\n”);}2.int fun(int x,int y,int * p,int * q){*p=x*y;*q=x/y;}void main( ){int a,b,c,d;a=4;b=3;fun(a,b,&c,&d);printf(“%d,%d\n”,c,d);}3.阅读下列程序,执行后的结果是#include “stdio.h”union bb{ long x[2]int y[4];char z[8];}atx;struct aa{ long x[2];int y[4];char z[8];}stx;main( ){ printf(“union bb=%d,struct aa=%d\n”,sizef(atx),sizef(stx));} 4.阅读下列程序,执行后的结果为#include “stdio.h”void main( ){ char str[ ]=“tomeetme”, str1[ ]=“toseeyou”;char *p=str,*p1=str1;int i;for(i=0;i<7;i++)if(*(p+i)= =*(p1+i))putchar(*(p+i));printf(“\n”);}四、阅读程序或程序段,填空(每小题4分,共20分)1....=1)2+)1,()(-(-nnnx+n+x+f+下面fac函数的功能是计算具有上面式子功能的递归函数。

float fac(int n,float x){float f;if(n<=0) {printf(“n<=0,dataerror!”);else if() f=sqrt(1+x);else f=;return(f);}2.下面程序的功能是计算100至500之间有多少个数其各位数字之和是8。

#include <stdio.h>void main(){ int i,s,k,count=0;for(i=100;i<=500;i++){s=0; k=i;while( ) {s=s+k%10;k =;}if(s! =8) continue;else count++;}printf(”%d”,count);}3.下面的程序读入数组元素值,然后以每行4个元素的形式输出。

#define N 20void main(){ int a[N],i;for (i=0; i<N;i++)scanf(“%d”,);for (i=0; i<N;i++){if () printf(“\n”);printf(“%8d”, a[i]);}printf(“\n”);}4.下面程序的功能是:使一个字符串按逆序存放,请填空#include <stdio.h>void main(){ char m,str[60]; int i,j;printf(“input a string:”);gets(str);for(i=0,j=strlen(str)-1;;i++,j--){m=str[i];;str[j]=m;}puts(str);}五、编程题(每小题10分,共20分)注意:程序的易读性非常重要。

如果卷面很乱,或难以读懂,将被扣分。

1.有1、2、3、4 共四个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?2. 从键盘输入的整数m 和n (m ≥n ≥0)后,计算下列表达式的值并输出。

)!(!!n m n m y -=要求将计算阶乘的运算写成函数fact(n),函数返回值的类型为float 。

相关文档
最新文档