Difficulty: Easy
Correct Answer: True
Explanation:
Introduction / Context:
C++ is a multi-paradigm language. It supports procedural, object-oriented, generic, and even functional programming styles. Teams often adopt different subsets of the language to match project needs, from small utilities to large frameworks with rich type hierarchies.
Given Data / Assumptions:
Concept / Approach:
As a superset of C's core model with added features, C++ permits writing purely procedural programs using functions and simple data structures, or fully object-oriented designs using classes, encapsulation, and polymorphism. Many real-world codebases mix paradigms, choosing the right tool for each module.
Step-by-Step Solution:
Write a procedural module using free functions and plain structs.Create an OO module with classes and virtual methods for extensibility.Link both modules; the language and toolchain support the coexistence effortlessly.Therefore, the statement is true: C++ can be used procedurally and object-oriented.
Verification / Alternative check:
Standard libraries themselves demonstrate multiple paradigms: algorithms are generic (templates), containers are object-oriented types, and many utilities are simple procedural functions.
Why Other Options Are Wrong:
Common Pitfalls:
Dogmatically restricting code to a single paradigm can reduce clarity. Use the paradigm that best fits the problem while maintaining consistency and readability.
Final Answer:
True.
Discussion & Comments