fibonacci(I am not getting the actual pattern ...please tell me the approach that what condition is using is this case)

I am not getting the exact relation like it is getting wrong everytime i try it…please tell me how to do it

hi @abhinavssr2003_eab0717682969e5c,
this is general term for fib Fn = Fn-1 + Fn-2
so you can use simple loop also and there is a recursive way also check this out : https://ide.codingblocks.com/s/655846
ive commented it

sir like recursively i have done but with loops i am not getting the condition…will you please help about it

hi @abhinavssr2003_eab0717682969e5c,
please check this https://ide.codingblocks.com/s/655847

Sir till now i haven’t studied arrays…

include

using namespace std;

int main(){

int n;

cin>>n;

int i,j,num=0,num1=1, next;

for(i = 1; i<=n ; i++){

    for (j = 1; j <= i; j++)

    {

        // cout<<(i-j)<<'\t';

       if (i==1 && j==1 )

       {

          cout<<num;

       }

       else if (i==2 && j==1)

       {

           cout<<num1;

       }

       else

       {    

                                 

       }

           

       }

                             

    cout<<endl;

    }



return 0;

}
Will you tell me what should i do in this?

@abhinavssr2003_eab0717682969e5c,
check here :- https://ide.codingblocks.com/s/655858

sir ho gya…like i just got my mistake

@abhinavssr2003_eab0717682969e5c,
nice one hope the doubt was clear

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.