Different code for the fibo series

can i get a different solution for the same problem … a little summed up ???

@pmschhabra can you share the code you have written so far so I can suggest changes in that?

#include using namespace std; int main(){ int a=0; int b=1; int n; cin>>n; int c; c=a+b; int i=2; int j=2; if(n>0) cout<<0<<endl; if(n>1) cout<<1; while(i<=n){ while(j<=i){ cout<<c; a=b; b=c; c=a+b; j++; } i++; cout<<endl; j=1; } }

@pmschhabra please save your code on ide.codingblocks.com and share the link

@pmschhabra your approach is perfectly fine, https://ide.codingblocks.com/s/191927 you can refer this for a cleaner code, although the approach used here is still more or less the same