Fibonacci sequence

it gives a compilation error pls help

Hello @lipikarustagi,

When i ran your code, it was giving no run time error.
Can you please explain the input format of your program?
It would be easier for me to find your mistake.

For now, i can see many mistakes in your code that is leading towards the wrong output.
But, first i would like to understand your approach.

resolved, can you pls check if its correct or not

Hello @lipikarustagi,

You have missed some cases in your code.
I have corrected all of them and now your code is working perfectly.
Please, refer to the comments for better understanding:

Hope, this would help.
Give a like, if you are satisfied.