Assertion (A) : To avoid repetition of code and bulky programs functionally related statements are isolated into a function.
Reason (R) : Function definition defines the body of the function.
UGC NET - 2014,
Answer: A
Both statements are true and (R) explains (A). Functionally related statements are collected into a function so that they need not be written again each time they are needed, which avoids repeated code and keeps programs short, so (A) is true.
A function definition is the place where the body of the function is written, so (R) is true, and since this body is the code written once and reused, it gives the way in which the repetition is avoided. Hence option (A).
Please log in or register to report this question.



