C++ program that Display a Fibonacci Series (that allow a user to enter the limit) - 6 Players blogs for technology

give us your feedback

People Online

Breaking

ads

Post Top Ad

Monday, October 14, 2019

C++ program that Display a Fibonacci Series (that allow a user to enter the limit)



C++ program that Display a Fibonacci Series (that allow a user to enter the limit)


#include <iostream>

using namespace std;

int main()
{
int limit;
int a=0,b=1,c;
cout<< "Enter the Fibonacci series limit : ";
cin>>limit;

for(c=0;c<=limit;c=a+b){

    a=b;
    b=c;
    cout<<c;
    if(b=c){
        cout<< " ";
    }
}

    return 0;
}


















No comments:

Post a Comment

ads1

Post Top Ad