1. Trang chủ
  2. » Công Nghệ Thông Tin

C++ và những câu hỏi liên quan

6 1,9K 3
Tài liệu được quét OCR, nội dung có thể không chính xác
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề C++ Và Những Câu Hỏi Liên Quan
Thể loại essay
Định dạng
Số trang 6
Dung lượng 216 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

C++ và những câu hỏi liên quan

Trang 1

Question #1

 What number of digits that can be accuratly stored in a float (based on the

IEEE Standard 754)?

b) 38

c) An unlimited number

Answer: A

Question #2

 Which of the following is evaluated first:

a) &&

b) ||

c) !

Answer: C

Question #3

 What does 7/9*9 equal (in C and C++)?

b) 0.08642

Answer: C

Question #4

 Which is not valid in C?

a) class aClass{public:int x;};

b) /* A comment */

c) char x=12;

Answer: A

Question #5

 Which of the following is not a valid declaration for main()?

Trang 2

a) int main()

b) int main(int argc, char *argv[])

c) They both work

Answer: C

Question #6

 Evaluate as true or false: !(1 &&0 || !1)

a) True

b) False

c) Invalid statement

Answer: A

Question #7

 Which command properly allocates memory?

a) char *a=new char[20];

b) char a=new char[20];

c) char a=new char(20.0);

Answer: A

Question #8

 What operator is used to access a struct through a pointer?

a) ->

b) >>

Answer: C

Question #9

 Which is not an ANSII C++ function?

Trang 3

a) sin()

b) kbhit()

c) tmpnam()

Answer: B

Question #10

 True or false, if you keep incrementing a variable, it will become negative?

a) True

b) False

c) It depends

Answer: C

Question #11

 What character terminates all character array strings

a) \0

b)

c) \END

Answer: A

Question #12

 If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops

out first?

Answer: A

Question #13

 What does strcat(an_array, "This"); do?

Trang 4

a) Copies "This" into an_array

b) Adds "This" to the end of an_array

c) Compares an_array and "This"

Answer: B

Question #14

 Evaluate:

int fn(int v)

{

if(v==1 || v==0)

return 1;

if(v%2==0)

return fn(v/2)+2;

else

return fn(v-1)+3;

}

for fn(7);

a) 10

b) 11

Answer: B

Question #15

 Evalute the following: 22%5

Answer: A

Question #16

 Which of the following data structures is on average the fastest for

retrieving data?

a) Binary Tree

b) Hash Table

Trang 5

c) Stack

Answer: B

Question #17

 What is the output:

int v()

{

int m=0;

return m++;

}

int main()

{

cout<<v();

}

c) Program is illegal

Answer: B

Question #18

 What does cout<<(0==0) print out?

c) Compiler error: Lvalue required

Answer: B

Question #19

 What is the maximum value of a unsigned char?

a) 255

b) 256

c) 128

Answer: A

Question #20

 Evaluate !(1&&1||1&&0)

Trang 6

a) Error b) True c) False

Answer: C

Ngày đăng: 18/08/2012, 11:39

TỪ KHÓA LIÊN QUAN

w