--:--









Quiz for Default arguments

Course: C++ Language | Subject: Unit 3 | Topic: Functions and Function Overloading



Logo

Q1: What is a default argument in C++?

Logo

Q2: Where are default arguments specified in C++?

Logo

Q3: Can default arguments be changed at the call site?

Logo

Q4: Which of the following is correct to declare a default argument?

Logo

Q5: What happens if default arguments are omitted in the middle of parameter list?

Logo

Q6: How are default arguments handled in overloaded functions?

Logo

Q7: What is true about default arguments and function pointers?

Logo

Q8: Can you provide default arguments in both declaration and definition?

Logo

Q9: Which function call uses default argument?

Logo

Q10: What will happen if a default argument is provided for a non-trailing parameter?

Logo

Q11: Can default arguments be expressions?

Logo

Q12: Are default arguments considered during function overload resolution?

Logo

Q13: Which keyword is used to specify default arguments?

Logo

Q14: What is the output of: void func(int a=5) { cout << a; } func(); ?

Logo

Q15: Can you have a default argument for a reference parameter?

Logo

Q16: What is a potential risk of using default arguments?

Logo

Q17: How many default arguments can a function have?

Logo

Q18: Can default arguments be of different types?

Logo

Q19: Which is true about default arguments and templates?

Logo

Q20: How do default arguments affect backward compatibility?

Are you ready to start test? Set your time limit