Quizne

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

Đề gồm 25 câu trắc nghiệm một lựa chọn môn Ngôn ngữ lập trình C; cả 25 câu đều có đáp án. Chọn Luyện tập để biết đúng sai từng câu, hoặc Thi thử có đồng hồ để lấy điểm thang 10.

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

Bảng đáp án (25 câu)
  1. 1. B
  2. 2. B
  3. 3. C
  4. 4. B
  5. 5. B
  6. 6. C
  7. 7. A
  8. 8. D
  9. 9. C
  10. 10. A
  11. 11. C
  12. 12. B
  13. 13. B
  14. 14. B
  15. 15. A
  16. 16. D
  17. 17. B
  18. 18. A
  19. 19. B
  20. 20. B
  21. 21. A
  22. 22. B
  23. 23. B
  24. 24. C
  25. 25. B