C++一组选择题

来源:百度知道 编辑:UC知道 时间:2024/05/30 10:38:47
2. Which is the legal identifier in C++?()
A.progarm a&b 2me B.ccun@mail C++ a_b
C. pi 变量a ab D. __line _123 Cout

3.设int a=7;float x=2.5,y=4.7。则x+a%3*<int>(x+y)%2/4的值()
A.2.5 B.2.75 C.3.5 D.0.0

4.以下不正确的函数声明格式为()
A. int fun(int ,int);
B.int fun(int y, int x);
C. int fun(int x,int y)
D.int fun(int i, int j);

6.关于数组,下面定义不正确的是()
A. char a[10]=”china”;
B. char a[10],*p=a;p=”china”;
C. char*a=0;
D. int *p=10;

7. Which is the legal identifier in C++?
A a_var B 2_test C #total D char

9.What is the output of the following program?
t=0;
while( true)
{
t++;
cout<<”*”;
if(t<3)
break;
}
A * B ** C 0 D nothing

1

2.D(找出合法的变量名)
3.A
4.C
6.C
7.A(找出合法的变量名)
9.A(给出下面的程序的输出结果)
10.D(如果有如下声明,那么下面哪一个是合法的声明)
11.D(给出下面的程序的输出结果)
12.C(哪一个语句是不正确的)
13.D(哪一个是正确的纯虚函数声明)

2.Which is the legal identifier in C++?
哪一个是合法标识符,选D
3.A
4.C
6.C
7.Which is the legal identifier in C++?
哪个在C++里是合法标识符,选A
9.What is the output of the following program
下面的程序输出什么?选A
10.If we have
int i=10;
const int m=20;
Which is the correct definition for reference?
如果我们有int a=10;const int m=20;哪一个是正确的,选D
11.What is the output of the following program?
下面的程序输出什么?选D
12.Which is the incorrect object definition?
哪一个不正确,选C
13.Which is the correct declaration about pure virtual function?
哪个是正确的定义virtual函数的语句,选D

可能选择有错,但番译是对的

楼上两位回答基本是正确的, 但有个我要究正一下

13.Which is the correct declaration about pure virtual function?
A virtual int vf(int); B void vf(int)=0;