What would be the answer of this?

closed account (EApGNwbp)
What is the value of the variable answer after the call to the function fun1 in the code below?
1
2
3
4
5
6
7
8
9
10
11
12
int main()
{
   int num1 = 1, num2 = 2, num3 = 3, num4 = 4, num5 = 5;
   int answer;
   answer = fun1(num2, num3, num4);
   cout << answer;
}

int fun1(int a, int b, int c, int d, int x)
{
   return (a + b + c + d + x);
}

What would be the output of answer?
Last edited on
- Really? So your only sending "fun1" 3 arguments, but it takes 5 arguments unless it is overloaded.

- There will not be an answer, this shouldn't even compile AFAIK.
Won't compile.
Topic archived. No new replies allowed.