Why are functions important in C?
a) For code reusability
b) For defining variables
c) For compiling code
d) For performing arithmetic
Answer:
a) For code reusability
Explanation:
Functions in C are essential for code reusability and modular programming. They allow you to define a block of code that performs a specific task and can be called multiple times from different parts of the program, avoiding code duplication. Functions help in breaking down complex programs into smaller, manageable units, improving readability, and making debugging and maintenance easier.
Understanding functions is key to writing efficient and organized C programs, as they enable you to encapsulate logic and reuse code across multiple projects or within the same project.