PTA选择题汇总
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
According to the declaration: int (*p)[10];, p is a(n) __. (2 分) A. pointer According to the declaration: int a[10], *p=a; the expression __ is wrong. (2 分) D. a++ According to the declaration: int a=10, b=20; the value of expression!a<b is __.(2 分) A.
7 According to the declaration: static int a[3][4]={0}; the correct description is __.(2 分) D. Every element in the array has initial value 0. According to the declaration:int a; the value of expression (a&3)==(a%4) is__. (2 分) B.
Given int a[2][3];. Which of the following can correctly make reference to arraya? (2 分) D. a[1>2][ !1] If all variables have been defined and declared in the following program, all the variables which can be used in function fun() are __. (2 分) A. x,y
表达式__的值是 0。 (2 分) C. 3/5
表达式 5>3>1 值是__. (2 分) A. 0 表达式 8>6>3 值是( )。 (2 分) A. 0
不正确的赋值或赋初值的方式是____。 (2 分) C. char str[10];str="string";
对于 C/C++语言的函数,下列叙述中正确的是( )。 (2 分) A. 函数的定义不能嵌套,但 函数调用可以嵌套
Among the following statements, __ is equivalent to while( *s++ = *t++ );. (2 分) A. do { *s = *t++; } while ( *s++ ); Among the followings, which group contains all the identifiers that are character pointers? (2 分) C. s1, s3, s4
The expression !(x>0||y>0) is equivalent to__。(2 分) A. !(x>0)&&!(y>0) The following code fragment outputs the string str. The loop conditionstr[i]!='\0' can be replaced by __. (2 分) A. str[i] The following code fragment prints out __. (2 分) A. 4
Which one is completely correct among the following program fragments? (2 分) C. int k, *p=&k; scanf("%d", p);
With regard to the array definition int a[4];,which expression among the following is wrong? (2 分) D. a++
For the following declarations of structure and variables, the correct description of the expression *p->str++; is __. (2 分) B. ++ acts on the pointer str For the following declarations, assignment expression __ is not correct. (2 分) B. p->name = st2.name
对于如下说明,语法和语义都正确的赋值是_____。 (2 分) C. s=&a[1];
对于以下结构定义,++p->str 中的++加在____。 (2 分) A. 指针 str 上 根据声明 int a[10], *p=a; ,下列表达式错误的是( )。 (2 分) C. a++ 假设 scanf 语句执行时输入 ABCDE<回车>,能使 puts(s)语句正确输出 ABCDE 字符串的程序 段是__。 (2 分) D. char *s; s="ABCDE"; puts(s); 将两个字符串连接起来组成一个字符串时,选用函数( )。 (2 分) C. strcat( )
The value of expression __ isn't 0. (2 分) B. !'\0'
The value of expression *((int *)(p+1)+2) is __. (2 分) D. 11 The value of expression sizeof("\num=%d\t") is (2 分) B. 8 A. 0
Among the following statements which intend to define arrays, which one is wrong? (2 分) C. int x[2][]={1,2,4,6};
Among the following statements, __ is equivalent to the declaration: int *p[4];.(2 分) C. int *(p[4]);
1 After executing the following code fragment, the value of variable m is __. (2 分) C. 10 After running the following piece of code, the value of s is __. (2 分) C. 6 Among the following assignments or initializations, __ is wrong. (2 分) A. char str[10]; str="string";
C 语言程序中可以对程序进行注释,注释部分必须用什么符号括起来? (2 分) C. '/*' 和 '*/'
C 语言中函数返回值的类型是由( )决定的。 (2 分) D. 定义函数时所指定的函数类型
For definition: struct { int n; char *str;} *p;,the operator ++ will act on __ in the expression ++p->str。 (2 分) A. poniter str
According to the C syntax, __is a legal character constant among the followings. (2 分) B. '\102'
According to the declaration: char c1=92,c2=92; the value of expression ___ is 0. (2 分) A. c1^c2
The following code fragment prints out __. (2 分) C. a=3, b=6
The following piece of code prints out __ . (2 分) C. 9
The following piece of code prints out__. (2 分) B. -1
The precedence of operator __ is the lowest one. (2 分) D. =
The precedence of operator __ is the lowest one. (2 分) C. +=
The precedence(优先级) of operator __ is the lowest among the followings. (2 分) D. +=
*p = a
is correct if it is used as a character constant. (2 分) D. 0xa
is wrong if it is used as an integer constant. (2 分) D. 1.0
SupΒιβλιοθήκη Baiduosing all the following variables are declared correctly. If executing the statement scanf("%d%c%f", &op1, &op, &op2);,the values of op1, op and op2are 1, * and 2.0, respectively, the the input must be __. (2 分) D. 1*2 The expression ___can NOT express the statement "both x and y are zero". (2 分) C. x==0 || y==0
1 According to the declaration: int a=12; the value of expression a+=a-=a*=a is __.(2 分) C.
0 According to the declaration: int p[5], *a[5];the expression __ is correct. (2 分) C. *(a+1)=p According to the declaration: int x=11;, the value of expressionx++*1/3 is_. (2 分) A. 3 According to the declaration: int x=23; the value of expression x++*1/3 is __. (2 分) A.
按照标识符的要求,( )不能组成标识符。 (2 分) A. 连接符
表达式 strcmp("box", "boss") 的值是一个____。(2 分) A. 正数
表达式( )的值是 0。 (2 分) A. 3/5
表达式__不能用于判断“x 和 y 不同时为零”。 (2 分) C. !(x==0 || y==0)
If x is a float variable, the value of expression x=10/4 is__. (2 分) B. 2.0 If a is an array with 4 integer elements, __ is not correct among the following declarations. (2 分) D. int i=4, a[i]; In the following declarations, the correct assignment expression is __. (2 分) C.
Among the following assignments or initializations, __ is wrong. (2 分) B. char s[10]; s="hello";
Among the following expressions in C, __ is correct. (2 分) D. 2==(3/2)
逻辑运算符两侧运算对象的数据类型( )。 (2 分) D. 可以是任何类型的数据
7 According to the declaration: static int a[3][4]={0}; the correct description is __.(2 分) D. Every element in the array has initial value 0. According to the declaration:int a; the value of expression (a&3)==(a%4) is__. (2 分) B.
Given int a[2][3];. Which of the following can correctly make reference to arraya? (2 分) D. a[1>2][ !1] If all variables have been defined and declared in the following program, all the variables which can be used in function fun() are __. (2 分) A. x,y
表达式__的值是 0。 (2 分) C. 3/5
表达式 5>3>1 值是__. (2 分) A. 0 表达式 8>6>3 值是( )。 (2 分) A. 0
不正确的赋值或赋初值的方式是____。 (2 分) C. char str[10];str="string";
对于 C/C++语言的函数,下列叙述中正确的是( )。 (2 分) A. 函数的定义不能嵌套,但 函数调用可以嵌套
Among the following statements, __ is equivalent to while( *s++ = *t++ );. (2 分) A. do { *s = *t++; } while ( *s++ ); Among the followings, which group contains all the identifiers that are character pointers? (2 分) C. s1, s3, s4
The expression !(x>0||y>0) is equivalent to__。(2 分) A. !(x>0)&&!(y>0) The following code fragment outputs the string str. The loop conditionstr[i]!='\0' can be replaced by __. (2 分) A. str[i] The following code fragment prints out __. (2 分) A. 4
Which one is completely correct among the following program fragments? (2 分) C. int k, *p=&k; scanf("%d", p);
With regard to the array definition int a[4];,which expression among the following is wrong? (2 分) D. a++
For the following declarations of structure and variables, the correct description of the expression *p->str++; is __. (2 分) B. ++ acts on the pointer str For the following declarations, assignment expression __ is not correct. (2 分) B. p->name = st2.name
对于如下说明,语法和语义都正确的赋值是_____。 (2 分) C. s=&a[1];
对于以下结构定义,++p->str 中的++加在____。 (2 分) A. 指针 str 上 根据声明 int a[10], *p=a; ,下列表达式错误的是( )。 (2 分) C. a++ 假设 scanf 语句执行时输入 ABCDE<回车>,能使 puts(s)语句正确输出 ABCDE 字符串的程序 段是__。 (2 分) D. char *s; s="ABCDE"; puts(s); 将两个字符串连接起来组成一个字符串时,选用函数( )。 (2 分) C. strcat( )
The value of expression __ isn't 0. (2 分) B. !'\0'
The value of expression *((int *)(p+1)+2) is __. (2 分) D. 11 The value of expression sizeof("\num=%d\t") is (2 分) B. 8 A. 0
Among the following statements which intend to define arrays, which one is wrong? (2 分) C. int x[2][]={1,2,4,6};
Among the following statements, __ is equivalent to the declaration: int *p[4];.(2 分) C. int *(p[4]);
1 After executing the following code fragment, the value of variable m is __. (2 分) C. 10 After running the following piece of code, the value of s is __. (2 分) C. 6 Among the following assignments or initializations, __ is wrong. (2 分) A. char str[10]; str="string";
C 语言程序中可以对程序进行注释,注释部分必须用什么符号括起来? (2 分) C. '/*' 和 '*/'
C 语言中函数返回值的类型是由( )决定的。 (2 分) D. 定义函数时所指定的函数类型
For definition: struct { int n; char *str;} *p;,the operator ++ will act on __ in the expression ++p->str。 (2 分) A. poniter str
According to the C syntax, __is a legal character constant among the followings. (2 分) B. '\102'
According to the declaration: char c1=92,c2=92; the value of expression ___ is 0. (2 分) A. c1^c2
The following code fragment prints out __. (2 分) C. a=3, b=6
The following piece of code prints out __ . (2 分) C. 9
The following piece of code prints out__. (2 分) B. -1
The precedence of operator __ is the lowest one. (2 分) D. =
The precedence of operator __ is the lowest one. (2 分) C. +=
The precedence(优先级) of operator __ is the lowest among the followings. (2 分) D. +=
*p = a
is correct if it is used as a character constant. (2 分) D. 0xa
is wrong if it is used as an integer constant. (2 分) D. 1.0
SupΒιβλιοθήκη Baiduosing all the following variables are declared correctly. If executing the statement scanf("%d%c%f", &op1, &op, &op2);,the values of op1, op and op2are 1, * and 2.0, respectively, the the input must be __. (2 分) D. 1*2 The expression ___can NOT express the statement "both x and y are zero". (2 分) C. x==0 || y==0
1 According to the declaration: int a=12; the value of expression a+=a-=a*=a is __.(2 分) C.
0 According to the declaration: int p[5], *a[5];the expression __ is correct. (2 分) C. *(a+1)=p According to the declaration: int x=11;, the value of expressionx++*1/3 is_. (2 分) A. 3 According to the declaration: int x=23; the value of expression x++*1/3 is __. (2 分) A.
按照标识符的要求,( )不能组成标识符。 (2 分) A. 连接符
表达式 strcmp("box", "boss") 的值是一个____。(2 分) A. 正数
表达式( )的值是 0。 (2 分) A. 3/5
表达式__不能用于判断“x 和 y 不同时为零”。 (2 分) C. !(x==0 || y==0)
If x is a float variable, the value of expression x=10/4 is__. (2 分) B. 2.0 If a is an array with 4 integer elements, __ is not correct among the following declarations. (2 分) D. int i=4, a[i]; In the following declarations, the correct assignment expression is __. (2 分) C.
Among the following assignments or initializations, __ is wrong. (2 分) B. char s[10]; s="hello";
Among the following expressions in C, __ is correct. (2 分) D. 2==(3/2)
逻辑运算符两侧运算对象的数据类型( )。 (2 分) D. 可以是任何类型的数据