program for fibbonicci series
July 26 2008, 8:54 AM
#include<conio.h>
#include<iostream.h>
int main()
{
int a,b,c,n;
a=0;
b=1;
cout<<"enter the no of terms you want to print";
cin>>n;
cout<<a<<"\n";
cout<<b;]
for(int i=1;i<=n-2;i++)
{
c=a+b;
cout<<"\n"<<c;
a=b;
b=c;
}
getch();
return(0);
}
Posted in c++ programming
0 comments
No comments yet. Be the first one to comment! |
Page 1 of 1
Statistics
Entries | 1 |
Comments | 0 |
Page views | 632 |
Last update | Jul 26, 2008 |