Multiple choice

Which one of the following is overloading the function? int sum(int x,int y) {}

  1. int sum(int x,int y,int z) {}

  2. float sum(int x,int y) {}

  3. int sum(int a,int b) {}

  4. all of the above

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

Function overloading occurs when multiple functions have the same name but different parameter lists (different number or types of arguments). Option A changes the number of arguments, which is a valid overload.