Here Is my code:
int mul(int x,int y)
It's perfectly simple:
mul() with 10 as the first argument, and the return value of
mul(m, n) as the second argument.
n are 10 and 5, so
mul(10, 5) returns 15. The statement in your
main function then evaluates to this:
sum = mul(10, 15);
Which is 25.
mul() is called twice. Once with
n as arguments. The second time with the sum of
n, adding 10
Using a debugger, or even looking at the assembler output generated by the compiler would've told you there were 2 successive calls to
And yes, as others have rightfully pointed out: reading the help section (in particular how to ask) would be a good idea. It explains that you're expected to do the sensible debugging/diagnostic steps yourself. Only if that didn't solve the problem should you post a question here:
Explain how you encountered the problem you're trying to solve, and any difficulties that have prevented you from solving it yourself.
You merely state that, given input X, you get output Y, and you don't know why.