Tạo Trắc Nghiệm

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

50 câu · Đề ôn tập tổng hợp

Xem trước: đọc nhanh mọi câu dạng chữ, chưa tính giờ, chưa hiện đáp án.
Luyện tập: chọn đáp án là biết đúng sai ngay, kèm lời giải.
Thi thử: nộp bài mới chấm điểm và hiện lời giải.

Câu 1

Which of the following functions compares two strings?

Đáp án và lời giải

Đáp án: D

Câu 2

Which of the following adds one string to the end of another?

Đáp án và lời giải

Đáp án: C

Câu 3

In which standard library file is the function printf( ) located?

Đáp án và lời giải

Đáp án: A

Câu 4

Which function is used to read the input from console?

Đáp án và lời giải

Đáp án: B

Câu 5

Which of the following are NOT relational operator?

Đáp án và lời giải

Đáp án: C

Câu 6

In the C program, the first statement that will be executed?

Đáp án và lời giải

Đáp án: A

Câu 7

Why are a function phototypes useful?

Đáp án và lời giải

Đáp án: A

Câu 8

Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1?

Đáp án và lời giải

Đáp án: B

Câu 9

Which of the following is not user define data type?
Media VietJack

Đáp án và lời giải

Đáp án: B

Câu 10

Identify which of the following are declarations
Media VietJack

Đáp án và lời giải

Đáp án: D

Câu 11

Is the following statement a declaration or definition?
Media VietJack

Đáp án và lời giải

Đáp án: A

Câu 12

Is there any difference between following declarations?
Media VietJack

Đáp án và lời giải

Đáp án: A

Câu 13

In the following program where is the variable a getting defined and where it is getting declared?
Media VietJack

Đáp án và lời giải

Đáp án: A

Câu 14

What are the types of linkages?

Đáp án và lời giải

Đáp án: B

Câu 15

Which of the following special symbol allowed in a variable name?

Đáp án và lời giải

Đáp án: D

Câu 16

By default a real number is treated as a

Đáp án và lời giải

Đáp án: B

Câu 17

How would you round off a value from 1.66 to 2.0?

Đáp án và lời giải

Đáp án: A

Câu 18

Is there any difference in the following declaration?
Media VietJack

Đáp án và lời giải

Đáp án: A

Câu 19

A long double can be used if range of a double is not enough to accommodate a real number?

Đáp án và lời giải

Đáp án: B

Câu 20

A float is 4 byte wide, whereas a double is 8 byte wide

Đáp án và lời giải

Đáp án: A

Câu 21

Size of short integer and long integer can be verified using the sizeof( ) operator

Đáp án và lời giải

Đáp án: A

Câu 22

If the definition of external variable occurs in the source file before its use in a particular function, then there is no need for an extern declaration in the function

Đáp án và lời giải

Đáp án: A

Câu 23

Global variable are available to all functions. Does there exist a mechanism by way of which it available to some and not to others

Đáp án và lời giải

Đáp án: B

Câu 24

Size of short integer and long integer would vary from one platform to another

Đáp án và lời giải

Đáp án: B

Câu 25

A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored?

Đáp án và lời giải

Đáp án: D

Câu 26

What are the difference types of real data type in C?

Đáp án và lời giải

Đáp án: C

Câu 27

What will be the ouput of the program?
Media VietJack

Đáp án và lời giải

Đáp án: C

Câu 28

Which library will you add in the following program to work it correctly?
Media VietJack

Đáp án và lời giải

Đáp án: A

Câu 29

What will you do to treat the constant 3.14 as a long double?

Đáp án và lời giải

Đáp án: B

Câu 30

What will you do to treat the constant 3.14 as a float?

Đáp án và lời giải

Đáp án: B

Câu 31

We want to round off x, a float, to an int value, The correct way to do is:

Đáp án và lời giải

Đáp án: A

Câu 32

What will be output of the program?
Media VietJack

Đáp án và lời giải

Đáp án: A

Câu 33

What will be output of program?
Media VietJack

Đáp án và lời giải

Đáp án: B

Câu 34

What will be output of program?
Media VietJack

Đáp án và lời giải

Đáp án: A

Câu 35

If the file tobe included does not exist, the preprocessor flashes an error message

Đáp án và lời giải

Đáp án: A

Câu 36

What is output of the program?
Media VietJack

Đáp án và lời giải

Đáp án: A

Câu 37

What will happen if in the C program you assign a value to a array element whose subscript exceeds the size of array?

Đáp án và lời giải

Đáp án: C

Câu 38

What is output of the program?
Media VietJack

Đáp án và lời giải

Đáp án: A

Câu 39

In which stage the following code. Gets replaced by the contents of the file stdio.h
Media VietJack

Đáp án và lời giải

Đáp án: D

Câu 40

What will be output of the program?
Media VietJack

Đáp án và lời giải

Đáp án: A

Câu 41

A function cannot be defined inside another function

Đáp án và lời giải

Đáp án: A

Câu 42

What is the notation for following functions?
Media VietJack

Đáp án và lời giải

Đáp án: C

Câu 43

Name of functions in two different files linked together must be unique.

Đáp án và lời giải

Đáp án: A

Câu 44

If return type for a function is not specified, it defaults to int

Đáp án và lời giải

Đáp án: A

Câu 45

A function may have ant number of return statements each returning different values.

Đáp án và lời giải

Đáp án: A

Câu 46

Functions cannot return more than one value at a time

Đáp án và lời giải

Đáp án: A

Câu 47

Function can be called either by value or reference

Đáp án và lời giải

Đáp án: A

Câu 48

How many times the program will print “laptrinhc++”?
Media VietJack

Đáp án và lời giải

Đáp án: C

Câu 49

In C all function except main( ) can be called recursively

Đáp án và lời giải

Đáp án: B

Câu 50

Is it true that too many recursive calls may result into stack overflow?

Đáp án và lời giải

Đáp án: A