CBSE Class 12 Computer Science Question 3 of 103

Working with Functions — Question 3

Back to all questions
3
Question

Question 3

Assertion. A parameter having a default in function header becomes optional in function call.

Reason. A function call may or may not have values for default arguments.

Answer

(a)

Both Assertion and Reason are true and Reason is the correct explanation of Assertion.

Explanation
When a parameter in a function header has a default value, it means that if no value is provided for that parameter during the function call, the default value will be used. This effectively makes the parameter optional in the function call. When calling a function with default arguments, we have the option to either provide values for those arguments or omit them, in which case the default values will be used.