C++ program to generate Fibonacci series

Program

#include<iostream.h>
using namespace std;
int main()
{
int a=0,b=1,i,n,c;
cout<<"enter the limit";
cin>>n;
cout<<endl<<a<<b;
for(i=2;i<=n;i++)
{
c=a+b;
cout<<c;
a=b;
b=c;
}
return 0;
}

Comments

Popular posts from this blog

Optical Charactor Recognition (OCR) in C#

How to create a transparent window in Windows Form Application

Installing MASM on Windows (32 bit or 64 bit)