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

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

A
Admin
IT TestTrắc nghiệm tổng hợp111 lượt thi
50 câu hỏi
1. Trắc nghiệm
• 1 điểm
Class members are public by default.

TRUE

FALSE

Xem đáp án

Chọn B

2. Trắc nghiệm
• 1 điểm
Friend functions have access only to public members of the class.

TRUE

FALSE

Xem đáp án

Chọn B

3. Trắc nghiệm
• 1 điểm
A function designed as public can be accessible by non-members of a class.

TRUE

FALSE

Xem đáp án

Chọn A

4. Trắc nghiệm
• 1 điểm
Friendship is commutative.

TRUE

FALSE

Xem đáp án

Chọn B

5. Trắc nghiệm
• 1 điểm
New and delete are operators.

TRUE

FALSE

Xem đáp án

Chọn A

6. Trắc nghiệm
• 1 điểm
We can implement generic classes using templates

TRUE

FALSE

Xem đáp án

Chọn A

7. Trắc nghiệm
• 1 điểm
Using operator overloading we can invent new operators.

TRUE

FALSE

Xem đáp án

Chọn B

8. Trắc nghiệm
• 1 điểm
Inheritance helps in making a general class into a more specific class.

TRUE

FALSE

Xem đáp án

Chọn A

9. Trắc nghiệm
• 1 điểm
A base class is never used to create objects.

TRUE

FALSE

Xem đáp án

Chọn B

10. Trắc nghiệm
• 1 điểm
Classes can be inherited privately.

TRUE

FALSE

Xem đáp án

Chọn A

11. Trắc nghiệm
• 1 điểm
It Is legal to return local variables from a function which returns by reference.

TRUE

FALSE

Xem đáp án

Chọn B

12. Trắc nghiệm
• 1 điểm
Constructors can be virtual like virtual destructors

TRUE

FALSE

Xem đáp án

Chọn B

13. Trắc nghiệm
• 1 điểm
C++ is a pure object oriented programming language.

TRUE

FALSE

Xem đáp án

Chọn B

14. Trắc nghiệm
• 1 điểm
In C++ one can define a function within another function.

TRUE

FALSE

Xem đáp án

Chọn B

15. Trắc nghiệm
• 1 điểm
A class encapsulates the implementation and interface of a userdefined data type and constitutes an abstract data type.

TRUE

FALSE

Xem đáp án

Chọn A

16. Trắc nghiệm
• 1 điểm
In c++ an identifier can begin with a $ sign.

TRUE

FALSE

Xem đáp án

Chọn A

17. Trắc nghiệm
• 1 điểm
“My Variable” is a valid identifier in C++

TRUE

FALSE

Xem đáp án

Chọn A

18. Trắc nghiệm
• 1 điểm
In C++ one can get the memory addresses of variables and functions.

TRUE

FALSE

Xem đáp án

Chọn A

19. Trắc nghiệm
• 1 điểm
%= is not a operator in C++

TRUE

FALSE

Xem đáp án

Chọn B

20. Trắc nghiệm
• 1 điểm
std::cout is a standard input stream.

TRUE

FALSE

Xem đáp án

Chọn B

21. Trắc nghiệm
• 1 điểm
Preprocessor #define macro and inline functions use the same mechanism.

TRUE

FALSE

Xem đáp án

Chọn B

22. Trắc nghiệm
• 1 điểm
All C++ functions are recursive.

TRUE

FALSE

Xem đáp án

Chọn A

23. Trắc nghiệm
• 1 điểm
The ‘break’ keyword is only used in the switch..case statement.

TRUE

FALSE

Xem đáp án

Chọn B

24. Trắc nghiệm
• 1 điểm
The new operator returns the address and size of the memory block that it allocates.

TRUE

FALSE

Xem đáp án

Chọn B

25. Trắc nghiệm
• 1 điểm
The heap storage is used for local objects.

TRUE

FALSE

Xem đáp án

Chọn B

26. Trắc nghiệm
• 1 điểm
It is not necessary to initialize a reference to real object when it is declared.

TRUE

FALSE

Xem đáp án

Chọn B

27. Trắc nghiệm
• 1 điểm
There can be a null reference.

TRUE

FALSE

Xem đáp án

Chọn B

28. Trắc nghiệm
• 1 điểm
One can reassign reference after it is initialized.

TRUE

FALSE

Xem đáp án

Chọn B

29. Trắc nghiệm
• 1 điểm
It is nothing wrong that a function returning a reference to an automatic variable.

TRUE

FALSE

Xem đáp án

Chọn B

30. Trắc nghiệm
• 1 điểm
One can apply pointer arithmetic with reference variables

TRUE

FALSE

Xem đáp án

Chọn B

31. Trắc nghiệm
• 1 điểm
The preprocessor processes source code before the compiler does.

TRUE

FALSE

Xem đáp án

Chọn A

32. Trắc nghiệm
• 1 điểm
A class is a basic unit of object-oriented programming.

TRUE

FALSE

Xem đáp án

Chọn B

33. Trắc nghiệm
• 1 điểm
A function template defines a parameterized nonmember function, which enables a program to call the same function with different types of arguments.

TRUE

FALSE

Xem đáp án

Chọn A

34. Trắc nghiệm
• 1 điểm
Destructors can be overloaded.

TRUE

FALSE

Xem đáp án

Chọn B

35. Trắc nghiệm
• 1 điểm
Static data members cannot be private.

TRUE

FALSE

Xem đáp án

Chọn B

36. Trắc nghiệm
• 1 điểm
Static member functions can use this pointer.

TRUE

FALSE

Xem đáp án

Chọn B

37. Trắc nghiệm
• 1 điểm
One cannot use enumerations in a class.

TRUE

FALSE

Xem đáp án

Chọn A

38. Trắc nghiệm
• 1 điểm
One cannot create an object of a virtual class.

TRUE

FALSE

Xem đáp án

Chọn B

39. Trắc nghiệm
• 1 điểm
A class that builds a linked list should destroy the list in the class destructor.

TRUE

FALSE

Xem đáp án

Chọn A

40. Trắc nghiệm
• 1 điểm
Once an exception has been thrown, it is not possible for the program to jump back to the throw point.

TRUE

FALSE

Xem đáp án

Chọn A

41. Trắc nghiệm
• 1 điểm
In C++, only one catch block can handle all the exceptions.

TRUE

FALSE

Xem đáp án

Chọn A

42. Trắc nghiệm
• 1 điểm
There can be only one catch block in a program.

TRUE

FALSE

Xem đáp án

Chọn B

43. Trắc nghiệm
• 1 điểm
When an exception if throw, but not caught, the program ignores the error.

TRUE

FALSE

Xem đáp án

Chọn B

44. Trắc nghiệm
• 1 điểm

A class object passed to a function template must overload any operators used on the class object by the template.

TRUE

FALSE

Xem đáp án

Chọn A

45. Trắc nghiệm
• 1 điểm
In the function template definition it is not necessary to use each type parameter declared in the template prefix.

TRUE

FALSE

Xem đáp án

Chọn B

46. Trắc nghiệm
• 1 điểm
It is possible to overload a function template and an ordinary (nontemplate) function.

TRUE

FALSE

Xem đáp án

Chọn A

47. Trắc nghiệm
• 1 điểm
A class template may not be used as a base class

TRUE

FALSE

Xem đáp án

Chọn B

48. Trắc nghiệm
• 1 điểm
When declaring an iterator from the STL, the compiler automatically creates the right kind, depending upon the container it is used with.

TRUE

FALSE

Xem đáp án

Chọn A

49. Trắc nghiệm
• 1 điểm
‘ios’ stream is derived from iostream.

TRUE

FALSE

Xem đáp án

Chọn B

50. Trắc nghiệm
• 1 điểm
What is the output of the following code?
Media VietJack

20,21

20,20

21, 22

none of above

Xem đáp án

Chọn D