Fibbonachi series

PHOTO EMBED

Wed Oct 25 2023 19:32:05 GMT+0000 (Coordinated Universal Time)

Saved by @yolobotoffender

#include <iostream>  
using namespace std;  
int main() {  
int a=0,b=1,c,sum,elements;
cout<<"enter he number of elements"<<endl;
cin>>elements;
for(int i=2;i<=elements;i++){
    if(i==1){
        cout<<a;}
        else if(i==2){cout<<a<<' '<<b<<' ';}
        else {c=a+b;
        cout<<' '<<c<<' ';
        a=b;
        b=c;
        }
        
    }

   return 0;  
   }  
content_copyCOPY