23.8k views
4 votes
When a function uses a mixture of parameters with and without default arguments,

the parameters with default arguments must be defined _________.

User Sathed
by
5.7k points

1 Answer

1 vote

Answer: after the required parameters.

Step-by-step explanation:

Default arguments in a function should be defined after the required parameters because the required parameters are necessary but default arguments are not. If mixed parameters are allowed it will be very hard for the compiler to to judge which value matches which argument so there will be syntax error.

User Brijal Savaliya
by
5.2k points