11.C++语言对C语言做了很多改进,C++语言相对于C语言的最根本的变化是
A)增加了一些新的运算符 B)允许函数重载,并允许设置缺省参数
C)规定函数说明符必须用原型 D)引进了类和对象的概念
【参考答案】 D
12.下列哪个是C++语言的有效标识符?
A)_No1 B)No.1 C)12345 D)int
【参考答案】 A
13.设有定义int x;float y;,则10+x+y值的数据类型是
A)int B)double C)float D)不确定
【参考答案】
14.下列程序的执行结果为
#include<iostream.h>
void main()
{ int a=3,b=0;
int *p=&a;
b=+a++;
cout<<*p<<","<<b<<endl; }
A)3,4 B)4,3 C)3,4 D)4,4
【参考答案】 B
15.下面程序的运行结果为
#include<iostream.h>
void main()
{ for(int a=0,x=0;!x&&a<=10;a++)
{ a++; }
cout<<a<<endl; }
A)10 B)11 C)12 D)0
【参考答案】 C
16.下列选项,不正确的是
A)for(int a=1;a<=10;a++); B)int a=1;
do
{ a++; }
while(a<=10)
C)int a=1; D)for(int a=1;a<=10;a++)a++;
while(a<=10)
{ a++; }
【参考答案】 B
17.下面关于数组的初始化正确的是
A)char str[]={′a′,′b′,′c′}
B)char str[2]={′a′,′b′,′c′}
C)char str[2][3]={{′a′,′b′},{′c′,′d′},{′e′,′f′}}
D)char str()={′a′,′b′,′c′}
【参考答案】 A
18.下列程序的输出结果为
#include<iostream.h>
void main()
{ char *a[]={"hello","the","world"};
char **pa=a;
pa++;
cout<<*pa<<endl; }
A)hello B)the C)world D)hellotheworld
【参考答案】 B
19.决定C++语言中函数的返回值类型的是
A)return语句中的表达式类型
B)调用该函数时系统随机产生的类型
C)调用该函数时的主调用函数类型
D)在定义该函数时所指定的数据类型
【参考答案】 D
20.下列程序的输出结果是
#include<iostream.h>
int min(int a,int b)
{ if (a<b)return a;
else return b;
return 0; }
void main()
{ cout<<min(1,min(2,3))<<endl; }
A)0 B)1 C)2 D)3
【参考答案】 B
[本文共有 5 页,当前是第 2 页] <<上一页 下一页>>