MCQ Collection
Programming Fundamentals MCQs
Programming Fundamentals MCQs for variables, loops, functions, arrays, and basic logic building.
A. A CPU instruction only
B. A sequence of characters
C. A compiler setting
D. A sequence of integers only
View Answer →
Correct Answer: B. A sequence of characters
A. A pointer that refers to memory no longer valid
B. A pointer to current valid data
C. A pointer with a meaningful name
D. A string function
View Answer →
Correct Answer: A. A pointer that refers to memory no longer valid
A. The value 5 only
B. The address of x
C. The string x
D. The type int
View Answer →
Correct Answer: B. The address of x
A. With a semicolon
B. With a comma
C. With a null character
D. With a space always
View Answer →
Correct Answer: C. With a null character
A. A loop counter
B. Allocated memory that is no longer reachable or freed
C. A successful output
D. A compiler warning color
View Answer →
Correct Answer: B. Allocated memory that is no longer reachable or freed
A. The keyboard layout
B. The font size
C. The number of comments
D. The size of the pointed-to type
View Answer →
Correct Answer: D. The size of the pointed-to type
A. n
B.
C. t
D. r
View Answer →
A. Keyboard
B. Printer
C. Monitor
D. Heap
View Answer →
A. Array names can behave like pointers to first elements
B. Arrays are compiler errors
C. Pointers cannot address arrays
D. Arrays and pointers are always identical in every context
View Answer →
Correct Answer: A. Array names can behave like pointers to first elements
A. bool
B. std::string
C. int
D. FILE only
View Answer →
Correct Answer: B. std::string
A. Stack
B. Router
C. Mouse
D. Speaker
View Answer →
A. goto only
B. manual memory leak
C. uninitialized pointer
D. std::vector
View Answer →
Correct Answer: D. std::vector