Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
258 B
2
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
    int n,i,s;
    cout<<"Enter number of elements required";
    cin>>n;
    int a=0,b=1;
    for(i=1;i<n;i++)
    {
        s=a+b;
        a=b;
        b=s;
        cout<<s<<"\n";
    }
    return 0;
}
Leave a Comment