Tạo Trắc Nghiệm

700+ câu trắc nghiệm Ngôn ngữ lập trình C có đáp án - Phần 6

25 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 is not a proper prototype?

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

Đáp án: B

Câu 2

What is the return type of the function with prototype: “int func(char x, float v, double t);”

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

Đáp án: B

Câu 3

Which of the following is a valid function call (assuming the function exists)?

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

Đáp án: C

Câu 4

Which of the following is a complete function?

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

Đáp án: B

Câu 5

What is required to avoid falling through from one case to the next?

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

Đáp án: B

Câu 6

What keyword covers unhandled possibilities?

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

Đáp án: C

Câu 7

What is the result of the following code? void main() { int x = 0; switch(x) { case 1: printf( "One" ); case 0: printf( "Zero" ); case 2: printf( "Hello World" ); } }

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

Đáp án: A

Câu 8

Which of the following is the proper declaration of a pointer?

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

Đáp án: D

Câu 9

Which of the following gives the memory address of integer variable a?

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

Đáp án: C

Câu 10

Which of the following gives the memory address of a variable pointed to by pointer a?

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

Đáp án: A

Câu 11

Which of the following gives the value stored at the address pointed to by pointer a?

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

Đáp án: C

Câu 12

Which of the following is the proper keyword or function to allocate memory in C?

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

Đáp án: B

Câu 13

Which of the following is the proper keyword or function to deallocate memory in C language?

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

Đáp án: B

Câu 14

Which of the following accesses a variable in structure b?

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

Đáp án: B

Câu 15

Which of the following accesses a variable in a pointer to a structure, *b?

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

Đáp án: A

Câu 16

Which of the following is a properly defined struct?

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

Đáp án: D

Câu 17

Which properly declares a variable of struct foo?

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

Đáp án: B

Câu 18

Which of the following correctly declares an array?

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

Đáp án: A

Câu 19

What is the index number of the last element of an array with 29 elements?

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

Đáp án: B

Câu 20

Which of the following is a two-dimensional array?

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

Đáp án: B

Câu 21

Which of the following correctly accesses the seventh element stored in foo, an array with 100 elements?

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

Đáp án: A

Câu 22

Which of the following gives the memory address of the first element in array arr, an array with 100 elements?

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

Đáp án: B

Câu 23

Which of the following is a string literal?

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

Đáp án: B

Câu 24

What character ends all strings?

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

Đáp án: C

Câu 25

Which of the following reads in a string named x with one hundred characters?

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

Đáp án: B