This is not your code!
So first thing to do is to read a reference about the Fibonacci sequence
Fibonacci number - Wikipedia, the free encyclopedia[
^].
Quote:
why the function returns 0 if i return 0
This is part of the definition F0= 0
Quote:
in the else condition,
why the function returns the value multiplied by 2 if I return 2 in the else condition.
Jumping from 1 to 2 is not necessary a multiplication. read source code more carefully.
Quote:
So the test scenario will be:
Fibonacci(5) // when (else return 0) | Result: 0
Fibonacci(5) // when (else return 1) | Result: 5 // Correct
Fibonacci(5) // when (else return 2) | Result: 10
No!
Check the reference to get the right answers.
Quote:
I don't understand why, and when the multiplication is happening.
Any explanation?
Because there is no multiplication!
Read again the source code.
You should learn to use the debugger as soon as possible. Rather than guessing what your code is doing, It is time to see your code executing and ensuring that it does what you expect.
The debugger allow you to follow the execution line by line, inspect variables and you will see that there is a point where it stop doing what you expect.
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[
^]
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jdb.html[
^]
https://www.jetbrains.com/idea/help/debugging-your-first-java-application.html[
^]