双语C期末复习资料(2013级)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
C语言(双语)复习资料(2013)
第1章C语言基础
1. int, char, float, double are all basic data types in C language. (对)
2. Provided that the length of int is 16 bits, then the value scope of unsigned int is:(B)
A.0~255 B.0~65535 C.-32768~32767 D.-256~255
3. The declaration is:
int k=0,a=0,b=0;
unsigned long w=5;
double x=1.42,y=0;
then the incorrect expression is_A__
A.y=x%3 B. w+= -2 C. x=w+5 D. k*=a+b
4. In C, basic data types are int, char, float and _double_____.
5. Suppose declaration: ch ar a=‟c‟; then statement: printf(“%d”,a); is wrong.(错)
6. Suppose declaration:
int a;
float x,y;
then the result data type of expression:
x+a%3*(int)(x+y)%2/4 is _float_____.
7. The data type of expression: 18/4*sqrt(4.0) is float. (错)
8. Suppose declaration: char a; then expression: ch=‟5+9‟ is correct.(错)
9. Incorrect string constant is: (A)
A. ‘abc‟
B. “1212”
C. “0”
D. “”
10. If Rate is a symbol constant,we can use it as Rate++. (错)
11. As variable name, tmpvar and TmpVar are same. (错)
12. Keywords can be used as variable names. (错)
13. The first character of variable name must be a letter or a underscore (_). (对)
14. Which of the following is error?(A)
A.Keywords can be used as variable names.
B.We tend to use short names for local variables, especially loop indices, and longer names for external variables.
C.Upper case and lower case letters in variable names are distinct.
D.The first character of variable name must be a letter or a underscore (_).
15. The statement: int n1=n2=10; is correct. (错)
16. The declaration: float f=f+1.1; is correct. (错)
17. Which of the following is the illegal variable names ?(D)
A.Lad B. n_10 C. _567 D. g#k
18. Suppose declaration: char c=‟\101‟;then the count of character in variable c is ___A__.(对)
19. Suppose declaration: char c=‟\061‟;then the count of character in variable c is ___1__.(对)
20. Suppose declaration: char c=‟\n‟;then the count of character in variable c is ___new-line_.(对)
说明:转义字符以\ 开头,\nnn 必须是8进制数。‘\102’可以视为一个字符。
21.The expression "(x=y=w=0,y=5+w, x=y)" is wrong.。(错)
这是一个逗号运算符的题目,逗号运算符具有最低优先级,先计算,后取值。
22. The result of expression: x=(i=4,j=16,k=32) is 32. (对)
23. The operand of operator ++/-- can be variables or constants. (错)
说明:自增自减运算符只能用于变量不能用于常量。例i++ , --k (对)3++ --6 (错)24. The % operator cannot be applied to a float or double. (对)
(%是取余数的运算符,只能用在整型数中)
25. Comments have no effect to the performance of program. (对)
26. C language has no input/output statement, just input/output functions instead. (对)
27. In C, comments must begin with __/*___ and end with _*/____. (对)
28. A C program, whatever its size, consists of _ functions___ and variables. (对)
29. An expression becomes a statementwhen it is followed by a __;____. (对)
30. Value of the assignment expression: c=25 is __25______ (对)
31. sum=sum+3 can be written as __ sum+=3______ (对)
第2章选择结构
1. (x<=y<=z) is C language expression for relationship x≤y≤z. (错)
2. Value of the expression …a‟+1==‟b‟ is false.(错)
3. (x<=y) && (x<=z) is C language expressionfor relationship x≤y≤z. (对)
4. When a is 1 and b is 0, the value of a||b is true. (对)
5. The declaration is:
int x=2,y=4,z=5;
which of the following expression equals to 0 ?(D)
A.x && y B x<=y C x||y+z&&y-z D !z
6. In the following operators, which one has the lowest precedence?(C)
A. *
B. &&
C. | |
D. =>
7. The result of expression: 3&&5||1%2 is 1. (对)
8. (ch>='A')&(ch<='Z')can tell you wheather variable ch is uppercase. (错)(必须用“&&”)
9. Which one can express x≥y≥z correctly?( A )
A. (x>=y)&&(y>=z)
B. (x>=y)and(y>=z)
C. x>=y>=z
D. (x>=Y)&&(Y>=z)
10. The correct expresson for 1≤x≤10 and 100≤x≤200 is _ (1<=x<=10) && (100<=x<=200)_.
11. Suppose declaration: w=1,x=2,y=3,z=4;then the value of w>x?w:y>z?y:z is 4. (对)
12. After running following block of program, value of variable m is ( D )
int w=1,x=2,y=3,z=4,m;
m=(w A.4 B 3 C 2 D 1 13. Suppose the following code segment: int w=1,x=2,y=3,z=4,m; m=(w m=(m m=(m