Function Overloading – MCQs July 22, 2025 by u930973931_answers 30 Score: 0 Attempted: 0/30 Subscribe 1. : What is function overloading in C++? (A) Defining multiple functions with the same name but different parameters (B) Defining multiple classes with the same name (C) Using inheritance for multiple classes (D) Writing multiple programs in one file 2. : Which of the following cannot be used to differentiate overloaded functions? (A) Number of parameters (B) Type of parameters (C) Return type of functions (D) Order of parameters 3. : What happens when two overloaded functions have the same parameters but different return types? (A) Compilation error (B) The function with larger return type is called (C) The function with smaller return type is called (D) Runtime error 4. : Which of the following is an example of function overloading? (A) int sum(int a, int b) and float sum(float x, float y) (B) int sum(int a) and int sum(int a) (C) int sum(int a) and int Sum(int a) (D) None of the above 5. : Can constructors be overloaded in C++? (A) Yes (B) No (C) Only in derived classes (D) Only for abstract classes 6. : What determines which overloaded function is called? (A) Return type (B) Function name (C) Argument list (D) Function body 7. : Overloaded functions must differ by: (A) Function name (B) Parameter list (C) Scope (D) File name 8. : Is it possible to overload a function by changing only the default values of parameters? (A) Yes (B) No (C) Only in classes (D) Only with inline functions 9. : Which feature allows the use of the same function name for different tasks? (A) Encapsulation (B) Inheritance (C) Overloading (D) Abstraction 10. : Which type of polymorphism does function overloading represent? (A) Run-time polymorphism (B) Compile-time polymorphism (C) Dynamic binding (D) Virtual polymorphism 11. : What is required for two overloaded functions? (A) Different return types (B) Different number or types of parameters (C) Different function names (D) Different scopes 12. : What is the keyword for overloading functions in C++? (A) overload (B) override (C) function (D) No keyword is needed 13. : Can the main function be overloaded in C++? (A) Yes (B) No (C) Only in templates (D) Only in inheritance 14. : Which of the following is invalid function overloading? (A) void print(int) and void print(float) (B) void print(int) and int print(int) (C) void print(int, float) and void print(float, int) (D) void print(int) and void print(int, int) 15. : Which one is a correct function overload? (A) void display() and int display() (B) void display(int) and void display(float) (C) display(int) and Display(int) (D) void display() and void Display() 16. : In which situation will function overloading fail? (A) Different number of parameters (B) Different parameter types (C) Same parameters but different return type (D) Different order of parameters 17. : Which of the following overloads are valid? (A) void func(int) and void func(double) (B) int func(int) and void func(int) (C) int func(int) and int func(int) (D) func() and Func() 18. : Can default arguments and function overloading coexist? (A) Yes (B) No (C) Only with inline functions (D) Only with constructors 19. : What is resolved at compile time in function overloading? (A) Function name (B) Function body (C) Function call (D) Function address 20. : What kind of error occurs if two functions have the same name and parameter types? (A) Logical error (B) Syntax error (C) Runtime error (D) Compile-time error 21. : Overloading functions improves: (A) Code security (B) Code readability and reusability (C) Memory usage (D) Compiler speed 22. : Function overloading is related to: (A) Multiple Inheritance (B) Virtual Functions (C) Polymorphism (D) Abstraction 23. : Function overloading is an example of: (A) Encapsulation (B) Data Hiding (C) Static Polymorphism (D) Dynamic Polymorphism 24. : Which of the following is NOT a reason to use function overloading? (A) Reduce redundancy (B) Increase readability (C) Increase compile time (D) Maintain consistency 25. : What is required to overload a function successfully? (A) Return types must differ (B) Parameter types or count must differ (C) Function names must differ (D) Classes must differ 26. : What happens if two functions differ only by return type? (A) Function with larger return type is called (B) Compiler error (C) Function with smaller return type is called (D) It compiles but fails at runtime 27. : Can overloaded functions have default arguments? (A) Yes, but carefully (B) No, it’s an error (C) Only if all arguments are default (D) Only in base classes 28. : Function overloading can occur in: (A) Only within a class (B) Only in global scope (C) Both class and global scope (D) Only in derived classes 29. : Which of the following is not true about overloaded functions? (A) They can have same name (B) They must differ in return type (C) They must differ in argument list (D) They are resolved at compile-time 30. : Why use function overloading? (A) To make code complex (B) To avoid writing multiple function names for similar tasks (C) To reduce the size of the program (D) To slow down the compilation