Why do we write functions?
I. Make our code easier to understand by giving a readable name to a group of instructions
II. Avoid writing repeated code
III. Make our code reusable
II and III
I only
I and II
I, II, and III
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The correct answer is: I, II, and III.
Explanation: We write functions for several reasons:
I. Functions provide a readable name to a group of instructions, which helps in understanding the code better.
II. They help avoid writing repeated code, as the same function can be called multiple times without rewriting the code.
III. Functions enhance code reusability, allowing developers to use the same logic in different parts of a program or across different projects.
All of these points make functions an essential part of programming.