Getting Incorrect answer?

I have done the code for Fast fibonacci which accepted same code I copied here and use ans=fib(r+2)-fib(l+1).Getting WA.Please review my code.Link:- https://ide.codingblocks.com/s/238074

@rishravi937
I saw the wrong question
Sorry buddy
While giving output do ((x-y)%mod+mod)%mod

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.