Quizne

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

Đề gồm 50 câu trắc nghiệm một lựa chọn môn Lập trình C/C++; cả 50 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 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

Bảng đáp án (50 câu)
  1. 1. D
  2. 2. C
  3. 3. A
  4. 4. B
  5. 5. C
  6. 6. A
  7. 7. A
  8. 8. B
  9. 9. B
  10. 10. D
  11. 11. A
  12. 12. A
  13. 13. A
  14. 14. B
  15. 15. D
  16. 16. B
  17. 17. A
  18. 18. A
  19. 19. B
  20. 20. A
  21. 21. A
  22. 22. A
  23. 23. B
  24. 24. B
  25. 25. D
  26. 26. C
  27. 27. C
  28. 28. A
  29. 29. B
  30. 30. B
  31. 31. A
  32. 32. A
  33. 33. B
  34. 34. A
  35. 35. A
  36. 36. A
  37. 37. C
  38. 38. A
  39. 39. D
  40. 40. A
  41. 41. A
  42. 42. C
  43. 43. A
  44. 44. A
  45. 45. A
  46. 46. A
  47. 47. A
  48. 48. C
  49. 49. B
  50. 50. A