vietjack.com

400 Câu hỏi trắc nghiệm lập trình C/C++ có đáp án (Phần 6)
Quiz

400 Câu hỏi trắc nghiệm lập trình C/C++ có đáp án (Phần 6)

A
Admin
50 câu hỏiIT TestTrắc nghiệm tổng hợp
50 CÂU HỎI
1. Nhiều lựa chọn

What is output? Media VietJack

A. LAPTRINHC++.NET

B. .NETLAPTRINHC++

C. Address of pstr[0] Address of pstr[1]

2. Nhiều lựa chọn

What is output? Giả sử dùng VC++ 2008 trên hệ điều hành 32 bit Media VietJack

A. 9

B. 12

C. 16

D. 24

3. Nhiều lựa chọn

What is output? Media VietJack

A. 20

B. 18

C. 32

D. 24

4. Nhiều lựa chọn

What is output? Media VietJackMedia VietJack

A. ID=1009, dd/mm/yyyy = 16/09/1989

B. ID = 1009, dd/mm/yyyy = garbage value/garbage value/garbage value (garbage value: giá trị rác)

C. Error sytax (Lỗi cú pháp)

5. Nhiều lựa chọn

What is output? Media VietJack

A. laptrinhc++ 2

B. Complier error

C. Runtime error

6. Nhiều lựa chọn

What is output? Media VietJack

A. 4

B. Complier error

C. 8

7. Nhiều lựa chọn

What is output? Media VietJack

A. 16

B. 22

C. 32

D. 18

8. Nhiều lựa chọn

Which of the following operators can be applied on structure variables?

A. Equality comparison ( == )

B. Assignment ( = )

C. Both of the above

D. None of the above

9. Nhiều lựa chọn

What is output? Media VietJack

A. 21

B. 27

C. Complier Error

D. Another

10. Nhiều lựa chọn

What is output? Media VietJack

A. 530

B. 70

C. 40

D. Complier Error

11. Nhiều lựa chọn

What is output? Media VietJack

A. Y = 3

B. Y = 5

C. Garbage value

12. Nhiều lựa chọn

What is output? Media VietJack

A. C/C++

B. Java

C. Complier error

13. Nhiều lựa chọn

What is output? Media VietJack

A. C/C++

B. Java

C. Complier error

14. Nhiều lựa chọn

What is output? Media VietJack

A. 1

B. 36

C. 6

D. 30

15. Nhiều lựa chọn

What is output? Media VietJack

A. 10 50

B. 10 10

C. 50 50

16. Nhiều lựa chọn

What is output? Media VietJack

A. 1000

B. 100

C. Complier error

17. Nhiều lựa chọn

What is output? Media VietJack

A. ‘laptrinhc++’ is printed 3 times

B. ‘laptrinhc++’ is printed 2 times

C. Complier error

18. Nhiều lựa chọn

A ____ is a special member function used to initialize the data members of a class.

A. constructor

B. destructor

C. static method

19. Nhiều lựa chọn

The default access for members of a class is ___ .

A. private

B. public

C. protected

D. protect

20. Nhiều lựa chọn

Member functions of a class are normally made ___ and data members of a class are normally made ___ .

A. private, public

B. protected, public

C. public, private

D. public, protected

21. Nhiều lựa chọn

Inheritance enables ___ which saves time in development , and encourages using previously proven and high quality software.

A. reusability

B. encapsulation

C. development

22. Nhiều lựa chọn

The three member access specifiers are ___, ___ and ___ .

A. public, private, protected

B. public, private, protect

C. public, private, static

23. Nhiều lựa chọn

A “has a” relationship between classes represents ___ and an “is a” relationship between classes represent ___ .

A. containment, inheritance

B. hiding, inheritance

C. encapsulation, inheritance

24. Nhiều lựa chọn

A pure virtual function is specified by placing ___ at the end of its prototype in the class definition.

A. =0

B. =1

C. =-1

25. Nhiều lựa chọn

A operator ___ is called as de-referencing operator.

A. &

B. *

C. &&

26. Nhiều lựa chọn

The size of a class with no data members and member functions is ___ bytes

A. 0

B. 1

C. 4

27. Nhiều lựa chọn

A class is called as abstract base class if it has a ___ function

A. pure virtual

B. static

C. private

28. Nhiều lựa chọn

Run-time or dynamic allocation of memory may be done using the C++ operator ___ .

A. new

B. alloc

C. malloc

29. Nhiều lựa chọn

Operator overloading permits to extend the applicability of existing C++ operators so that they work with new ___ or ___.

A. data types, objects

B. data types, constant

C. data types, pointer

30. Nhiều lựa chọn

A ___ is a set of instance or values.

A. class

B. object

C. function

31. Nhiều lựa chọn

C++ programming language was designed and developed by ___ at ___.

A. Steven Job, AT&T Bell Labs

B. Bjarne Stroustrup, AT&T Bell Labs

C. Guido van Rossum, M&D Lab

32. Nhiều lựa chọn

C++ is a ___ programming language with ___ extensions.

A. procedural, object oriented

B. object, procedural

C. procedural, STL

33. Nhiều lựa chọn

Pointers are ___ that contain the addresses of other variables and ____ .

A. value, object

B. object, class

C. variables, functions

34. Nhiều lựa chọn

A program can use the address of any variable in an expression, except variables declared with the ___ storage class.

A. static

B. register

C. auto

35. Nhiều lựa chọn

New operator allocates memory blocks from the ___.

A. Stack

B. Heap

C. Register

36. Nhiều lựa chọn

The new operator throws a ___ when heap is exhausted.

A. runtime exception

B. syntax error

C. logic error

37. Nhiều lựa chọn

The (assert.h) header is used for ___ .

A. debugging

B. checking memory leak

C. library for time

38. Nhiều lựa chọn

The constructor and destructor of a class in C++ are called ___

A. automatically

B. manually

C. none of above

39. Nhiều lựa chọn

Two or more functions may have the same name, as long as their ___ are different.

A. return type

B. parameter lists

C. none of above

40. Nhiều lựa chọn

A constructor with default arguments for all its parameters is called a ___ constructor.

A. static

B. run-time

C. default

41. Nhiều lựa chọn

Run time polymorphism is ___ than the compile time polymorphism.

A. dynamic

B. static

C. public

42. Nhiều lựa chọn

The two types of polymorphism is : ____ & ____ .

A. Run time and compile time

B. Preprocessor, compile time

C. Preprocessor, Linker

43. Nhiều lựa chọn

A file stream is an extension of a ___ stream.

A. console

B. windows

C. none of above

44. Nhiều lựa chọn

The Standard Template Library(STL) is a library of ___ templates.

A. container class

B. time class

C. none of above

45. Nhiều lựa chọn

Run time polymorphism is ___ than the compile time polymorphism.

A. less flexible

B. more flexible

C. none of above

46. Nhiều lựa chọn

With private inheritance, public and protected members of the base class become ___ members of the derived class.

A. private

B. public

C. protected

47. Nhiều lựa chọn

The STL Container adapters contains the ___ , ___ and ___ STL containers.

A. Stack, Queue, Priority_queue

B. Set, Multiset, Map

C. vectors, lists, deques

48. Nhiều lựa chọn

The ___ block contains code that directly or indirectly might cause an exception to be thrown.

A. catch

B. try

C. none of above

49. Nhiều lựa chọn

When writing function or class template, one use a ___ to specify a generic data type.

A. template parameters

B. keyword

C. none of above

50. Nhiều lựa chọn

Data items in a class may be public.

A. TRUE

B. FALSE

© All rights reserved VietJack