山东师范大学10-11电子C语言期末试题
更新时间:2023-10-23 18:56:01 阅读量: 综合文库 文档下载
日 - -- - --月--- - -- - 年---- -- -- - -- - -- - -- - :---间---时--试---考--- - -- - --- -- - -- - --- -- - 线- - - --业- 专--- -- -- - -- - -- - -- - 封 --)-部---(---院--- -- - -- - -- 密 - --- --名-姓--- --- -- - -- - --- -- - -- - --- -- - -- - -- - -- - 号----学-山东师范大学2010-2011学年第1学期期末考试试题
(时间:120分钟 共100分)
课程编号:080920201、080940201 课程名称:C语言程序设计 试题类别: A考试类型:闭卷
适用年级:2010 适用专业:电子信息工程、电子科学与技术 题号 I II III 总分 阅卷人 复核人 得分
Part Ⅰ
For each of the following questions, fill-in one of either: A, B, C, or D on the blanks. (There are 15 questions, each of which is worth 2 mark.total 40.)
得 分 评阅人 1. ( ) 2. ( ) 3. ( ) 4. ( ) 5. ( ) 6. ( ) 7. ( ) 8. ( ) 9. ( ) 10. ( ) 11. ( ) 12. ( ) 13. ( ) 14. ( ) 15. ( ) 16. ( ) 17. ( ) 18. ( ) 19. ( ) 20. ( )
1. If x is a float variable, the value of expression (x=10/4) is _____ 。
A) 2.5 B) 2.0 C) 3 D) 2
2. If variables are defined and assigned correctly, the expression ______ is wrong.
A) a&b B) a^b C) &&x D) a, b
3. According to the declaration: int a[10], *p=a; the expression ______ is wrong.
A) a[9] B) p[5] C) *p++ D) a++ 4. ______ is wrong.
A) char str[10]; str=\ B) char str[ ]=\ C) char *p=\ D) char *p; p=\5. The precedence of operator _____ is the highest one.
A) += B) [] C) & D) ++ 6. The valid C expression of mathematical expression 1≤x≤5 is .
A) 1<=x<=5 B) (x> =1)&(x<=5 ) C) (x>=1 )&&(x<=5) D) (1 < =x)||(5> =x) 7. Which one of following marks can be defined as identifier?
A) int B)float C) char D)string
8.Having declaration statement: int a=1, b=2, c=3; the value of expression
(a>b>c,a
A) 0 B)1 C) 2 D) 3
9. Given the following declarations of arrays, which one is valid.
A) char str[30]= {12,23,34}; B) int a[ ] ; C) int x[4] [ ]; D) int x[ ][5]; 10. data type of variable f and i:
float f=3.14; int i;
which expression of following is legal.
A) i=(int)f%5 B) i=int(f)%5 C) i=f%5 D) i=(int f)%5
11. Which one of following marks can be defined as identifier?
A) main B) _0 C)void D) sizeof
12. Having initialization: int a=6,b=5,c=8,d=7,m=2,n=2; the value of m and n after executed the expression (m=c A) 0 0 B) 0 2 C) 0 1 D) 2 2 13. Having declaration statement:char s[]=\ The value of a is A) 7 B)8 C) 13 D) 11 14. while((ch=getchar()) ==’e’) printf(“*”); Having inputted abcde 16. According to the declaration: int p[5], *a[5]; the expression ______ is correct. A) p=a B) p[0]=a C) *(a+1)=p D) a[0]=2 17. Fill in the blank and complete the following function used to calculate the sum of two integers, and return the result by formal parameter. void func(int x,int y, ) { *z=x+y; } A) int *z B) int z C) &z D)int &z 18. What will be output after execution of following programming? main() { char s[]=\ printf(\ printf(\ } A) 13 B) 23 C) 16 D) 26 19. What will be output after execution of following programming? main(){int i,j; char a[ ]=”Excellent!”; a[5]=0;i=sizeof(a); j=strlen(a); printf(“%d,%d\\b”,i,j); } A) 5,11 B) 6,11 C) 10,6 D) 11,5 20. What will be output after execution of following programming? main() { int x=5,a=0,b=0; switch(x){ case 0:a++; break; case 1:b++; break; case 2:a++; break; } printf(“a=%d,b=%d\\n”,a,b); } A) a=2,b=1 B) a=1,b=1 C) a=1,b=0 D) a=0,b=0 Part Ⅱ Consider the following programs and write what will be output after execution (There are 10 questions, each of which is worth 5 marks. total 50.) 1 得 分 评阅人 1. main() { int a, b; for(a=1, b=1; a<=100; a++) { if(b>=10) break ; if (b%3==1) { b+=3; continue; } } printf(“%d\\n”,a); } 2. #include \#include \main() { int digit, sum=0, num=1234; while(num!=0) { digit=num; num=num/10; sum+=digit; } printf(\} 3. main() { int a=15,b=21,m=0; switch(a%3) { case 0:m++;break; case 1:m++; } switch(b%2) { default:m++; case 0:m++;break;} printf(\} 4. #define MAX(x,y) (x)>(y)?(x):(y) main() { int a=5,b=2, c=3,d=3,t; t=MAX(a+b,c+d) *10; printf(“%d\\n”,t); } 5. #include { int k=0,*ps, a[11]={ 1,2,3,4,5,6,7,8,9,10}; for(ps=a;*ps!=0; ps+=2) k+=*ps; printf(“%d\\n”,k); } 6. #include { char *s=“Henan”, *ss=”Hebei”; strcmp(ss, s)<0? printf(“%s”,ss): printf(“%s”,s);} 7. #include void move(char *str, int n) { char temp ; int i; temp=str[0]; for(i= 1; i } main() { char s[]=”abcdef”; int i, z; int n=3; z=strlen(s); for(i=1; i<=n; i++) move(s,z); printf(\ } 2 8. #include static int f=1; f=f*n; return f; } main() { int i; for(i=1;i<5;i++) printf(\} 9. #include \main() { int a[2][3]={11,23,6,89,45,23}; int (*pa)[3]; pa=a; printf( \} #include { char a[][10]={“morning”,”afternoon”,”evening”},*pa[3]; int i; pa[0]=a[0]; pa[1]=a[1]; pa[2]=a[2]; for(i=0;i<3;i++){ printf(“Good ”); printf(\ printf(\n\!’ ); } } Part Ⅲ (There are 1 questions, worth 10 marks.) 得 分 评阅人 Write a function can be called to find the value and position of largest element in the two-dimensional array given by main function. #include int a[4][3]={{13, 24, 35}, {3, 76, 78}, {91, 0, 151}, {12, 63,108}}; 3
正在阅读:
山东师范大学10-11电子C语言期末试题10-23
全国2010年7月高等教育自学考试钢结构试题与答案03-05
最新ISOTS22163:2017一整套程序文件(轨道交通业质量管理体系)06-07
有花可赏,有诗可读,这才是最好的春日10-15
养母杨新雨阅读答案11-19
部编版小学一至三年级古诗词竞赛试卷01-18
高中数学知识点《统计与概率》《概率》《概率综合》精选专题练习(含答案考点及解析)12-22
纠察队规章制度09-27
泉州泉港历史人文趣事 - 图文10-25
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 山东师范大学
- 期末
- 试题
- 语言
- 电子
- 10
- 11