- Home
- Class - 12 CBSE Computer Science — Assertion Reason Type Questions
Assertion. A parameter having a default
Class - 12 CBSE Computer Science — Assertion Reason Type Questions
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.