CBSE Class 12 Computer Science Question 6 of 103

Working with Functions — Question 6

Back to all questions
6
Question

Question 6

Assertion. A parameter having a default value in the function header is known as a default parameter.

Reason. The default values for parameters are considered only if no value is provided for that parameter in the function call statement.

Answer

(b)

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

Explanation
A default parameter is a parameter in a function definition that has a predefined value. When we call a function with default parameters, if we don't provide a value for a parameter, the default value specified in the function header will be used instead.