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

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

A
Admin
IT TestTrắc nghiệm tổng hợp151 lượt thi
50 câu hỏi
1.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

LAPTRINHC++.NET

NETLAPTRINHC++

Address of pstr[0] Address of pstr[1]

Xem đáp án

Chọn B

2.Trắc nghiệm
• 1 điểm
What is output? Giả sử dùng VC++ 2008 trên hệ điều hành 32 bit
Media VietJack

9

12

16

24

Xem đáp án

Chọn B

3.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

20

18

32

24

Xem đáp án

Chọn A

4.Trắc nghiệm
• 1 điểm
What is output?
Media VietJackMedia VietJack

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

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

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

Xem đáp án

Chọn A

5.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

laptrinhc++ 2

Complier error

Runtime error

Xem đáp án

Chọn B

6.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

4

Complier error

8

Xem đáp án

Chọn A

7.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

16

22

32

18

Xem đáp án

Chọn A

8.Trắc nghiệm
• 1 điểm
Which of the following operators can be applied on structure variables?

Equality comparison ( == )

Assignment ( = )

Both of the above

None of the above

Xem đáp án

Chọn D

9.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

21

27

Complier Error

Another

Xem đáp án

Chọn B

2048.vn

Học thông minh hơn mỗi ngày

Xem toàn bộ 50 câu hỏi và nhiều hơn nữa với tài khoản miễn phí

Tạo đề thi
Tổ chức kiểm tra
Báo cáo chấm điểm tự động
Bạn đã có tài khoản?
10.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

530

70

40

Complier Error

Xem đáp án

Chọn C

11.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

Y = 3

Y = 5

Garbage value

Xem đáp án

Chọn B

12.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

C/C++

Java

Complier error

Xem đáp án

Chọn C

13.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

C/C++

Java

Complier error

Xem đáp án

Chọn C

14.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

1

36

6

30

Xem đáp án

Chọn B

15.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

10 50

10 10

50 50

Xem đáp án

Chọn A

16.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

1000

100

Complier error

Xem đáp án

Chọn C

17.Trắc nghiệm
• 1 điểm
What is output?
Media VietJack

‘laptrinhc++’ is printed 3 times

‘laptrinhc++’ is printed 2 times

Complier error

Xem đáp án

Chọn C

18.Trắc nghiệm
• 1 điểm
A ____ is a special member function used to initialize the data members of a class.

constructor

destructor

static method

Xem đáp án

Chọn A

19.Trắc nghiệm
• 1 điểm
The default access for members of a class is ___ .

private

public

protected

protect

Xem đáp án

Chọn A

20.Trắc nghiệm
• 1 điểm
Member functions of a class are normally made ___ and data members of a class are normally made ___ .

private, public

protected, public

public, private

public, protected

Xem đáp án

Chọn C

21.Trắc nghiệm
• 1 điểm
Inheritance enables ___ which saves time in development , and encourages using previously proven and high quality software.

reusability

encapsulation

development

Xem đáp án

Chọn A

22.Trắc nghiệm
• 1 điểm
The three member access specifiers are ___, ___ and ___ .

public, private, protected

public, private, protect

public, private, static

Xem đáp án

Chọn A

23.Trắc nghiệm
• 1 điểm
A “has a” relationship between classes represents ___ and an “is a” relationship between classes represent ___ .

containment, inheritance

hiding, inheritance

encapsulation, inheritance

Xem đáp án

Chọn A

24.Trắc nghiệm
• 1 điểm
A pure virtual function is specified by placing ___ at the end of its prototype in the class definition.

=0

=1

=-1

Xem đáp án

Chọn A

25.Trắc nghiệm
• 1 điểm
A operator ___ is called as de-referencing operator.

&

*

&&

Xem đáp án

Chọn B

26.Trắc nghiệm
• 1 điểm
The size of a class with no data members and member functions is ___ bytes

0

1

4

Xem đáp án

Chọn B

27.Trắc nghiệm
• 1 điểm
A class is called as abstract base class if it has a ___ function

pure virtual

static

private

Xem đáp án

Chọn A

28.Trắc nghiệm
• 1 điểm
Run-time or dynamic allocation of memory may be done using the C++ operator ___ .

new

alloc

malloc

Xem đáp án

Chọn A

29.Trắc nghiệm
• 1 điểm
Operator overloading permits to extend the applicability of existing C++ operators so that they work with new ___ or ___.

data types, objects

data types, constant

data types, pointer

Xem đáp án

Chọn A

30.Trắc nghiệm
• 1 điểm
A ___ is a set of instance or values.

class

object

function

Xem đáp án

Chọn B

31.Trắc nghiệm
• 1 điểm
C++ programming language was designed and developed by ___ at ___.

Steven Job, AT&T Bell Labs

Bjarne Stroustrup, AT&T Bell Labs

Guido van Rossum, M&D Lab

Xem đáp án

Chọn B

32.Trắc nghiệm
• 1 điểm
C++ is a ___ programming language with ___ extensions.

procedural, object oriented

object, procedural

procedural, STL

Xem đáp án

Chọn A

33.Trắc nghiệm
• 1 điểm
Pointers are ___ that contain the addresses of other variables and ____ .

value, object

object, class

variables, functions

Xem đáp án

Chọn C

34.Trắc nghiệm
• 1 điểm
A program can use the address of any variable in an expression, except variables declared with the ___ storage class.

static

register

auto

Xem đáp án

Chọn B

35.Trắc nghiệm
• 1 điểm
New operator allocates memory blocks from the ___.

Stack

Heap

Register

Xem đáp án

Chọn B

36.Trắc nghiệm
• 1 điểm
The new operator throws a ___ when heap is exhausted.

runtime exception

syntax error

logic error

Xem đáp án

Chọn A

37.Trắc nghiệm
• 1 điểm
The (assert.h) header is used for ___ .

debugging

checking memory leak

library for time

Xem đáp án

Chọn A

38.Trắc nghiệm
• 1 điểm
The constructor and destructor of a class in C++ are called ___

automatically

manually

none of above

Xem đáp án

Chọn A

39.Trắc nghiệm
• 1 điểm
Two or more functions may have the same name, as long as their ___ are different.

return type

parameter lists

none of above

Xem đáp án

Chọn B

40.Trắc nghiệm
• 1 điểm
A constructor with default arguments for all its parameters is called a ___ constructor.

static

run-time

default

Xem đáp án

Chọn C

41.Trắc nghiệm
• 1 điểm
Run time polymorphism is ___ than the compile time polymorphism.

dynamic

static

public

Xem đáp án

Chọn B

42.Trắc nghiệm
• 1 điểm
The two types of polymorphism is : ____ & ____ .

Run time and compile time

Preprocessor, compile time

Preprocessor, Linker

Xem đáp án

Chọn  A

43.Trắc nghiệm
• 1 điểm
A file stream is an extension of a ___ stream.

console

windows

none of above

Xem đáp án

Chọn A

44.Trắc nghiệm
• 1 điểm
The Standard Template Library(STL) is a library of ___ templates.

container class

time class

none of above

Xem đáp án

Chọn A

45.Trắc nghiệm
• 1 điểm
Run time polymorphism is ___ than the compile time polymorphism.

less flexible

more flexible

none of above

Xem đáp án

Chọn B

46.Trắc nghiệm
• 1 điểm
With private inheritance, public and protected members of the base class become ___ members of the derived class.

private

public

protected

Xem đáp án

Chọn A

47.Trắc nghiệm
• 1 điểm
The STL Container adapters contains the ___ , ___ and ___ STL containers.

Stack, Queue, Priority_queue

Set, Multiset, Map

vectors, lists, deques

Xem đáp án

Chọn C

48.Trắc nghiệm
• 1 điểm
The ___ block contains code that directly or indirectly might cause an exception to be thrown.

catch

try

none of above

Xem đáp án

Chọn B

49.Trắc nghiệm
• 1 điểm
When writing function or class template, one use a ___ to specify a generic data type.

template parameters

keyword

none of above

Xem đáp án

Chọn A

50.Trắc nghiệm
• 1 điểm
Data items in a class may be public.

TRUE

FALSE

Xem đáp án

Chọn A

Bạn có thích hoạt động này không?

Hãy lưu hoặc chia sẻ nội dung này đến mọi người.

Khám phá các nguồn tài nguyên miễn phí, phù hợp với tiêu chuẩn trong vài giây

Gợi ý cho bạn

Xem tất cả

Học liệu phổ biến Trắc nghiệm tổng hợp

Xem tất cả

Học liệu phổ biến IT Test

Xem tất cả