Multiple choice technology programming languages

Which of the following is an error in calling the function? void func( int i = 5, double d = 1.234 );

  1. func( 9, 5.67 )

  2. func( 4 )

  3. func()

  4. func( ,4 )

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In C++, when calling a function with default parameters, you cannot skip an earlier parameter while providing a value for a later parameter. If you want to specify the second parameter, you must also provide a value for the first parameter. The syntax 'func(,4)' is invalid because it omits the first argument.