IGDTUW 2025 — Computer PYQ
IGDTUW | Computer | 2025What is the main benefit of using 'Libraries' in C++?
Choose the correct answer:
- A.
They prevent the computer from getting too hot.
- B.
They allow you to reuse high-quality code written by others.
(Correct Answer) - C.
They are required to make the text in the code look better.
- D.
They make the final program file much larger.
They allow you to reuse high-quality code written by others.
Explanation
The correct answer is (b) They allow you to reuse high-quality code written by others.
Explanation
In C++ programming, a Library is a collection of pre-compiled code (functions, classes, variables) that you can include in your own programs. Instead of writing complex functionality—like networking, graphical user interfaces, or advanced mathematics—from scratch, developers can simply include an existing library.
This concept is foundational to efficient software development. It promotes code reusability, reduces development time, and leverages the expertise of other developers.
Conceptual Representation
If Ptotal is the total project time and Wcustom is the time spent on custom logic, and Wlib is the time saved by using external libraries:
Ptotal=Wcustom+(Woriginal−Wlib)
Where W_{lib} > 0 signifies the efficiency gain. By using libraries, we effectively minimize the effort required to reach the final executable state:
Effortreduced∝UsageLibraries1
