Untitled

Anonymous
plain_text
03/18/2024 6:00 AM
344 B
29
Indexable
#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;
}
Editor is loading...
Leave a Comment