Fibinacci series number

this code is not running in my compiler please send me the code and explain me

Fibonacci is a series 0,1,1,2,3,5,8,13… where first term is 0 second term is 1 and then onwards number is the sum of previous 2 numbers
refer this https://ide.codingblocks.com/s/285511
I have implemented the same using 3 methods.

  1. normal recursion
  2. top down DP
  3. Bottom up DP

please explain me in easy way that’s a very long problem

kindly watch video. prateek sir has explained it very well. also its not a tough problem.
basic concept is just Fibonacci is a series 0,1,1,2,3,5,8,13… where first term is 0 second term is 1 and then onwards number is the sum of previous 2 numbers

in my compiler its not running c is unutilized its showing I don’t know why

#include using namespace std; int fab(int n){ int a = 0; int b = 1; int c; for(int i=1;i<=n-1;i++){ c = a + b; a = b; b = c; } return c; } int main() { int n; cin>>n; cout<<fab(n)<<endl; return 0; }

save ur code on ide and send… btw ur code seems fine… what problem are u facing??

c is not utilised here and giving me the output wrong please check it once

save code on ide and send na… and well what difficulty are u having… prateek bhaiya has explained it so well… if u face difficulty watch video twice or thrice… stop always just saying send code… if u dont try how will u learn

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.