Source Code:-
#include<iostream.h>
#include<conio.h>
int main()
{
long int a=0,b=1,c=0,j;
cout<<"Enter the terms upto which you want to have faboncii series: ";
cin>>j;
cout<<a<<"\n";
//cout<<b<<"\n";
for (int i=0;i<=j;i++)
{
a=b;
b=c;
c=a+b;
cout<<c<<"\n";
}
getch();
return 0;
}
rishabhbaid96@gmail.com
#include<iostream.h>
#include<conio.h>
int main()
{
long int a=0,b=1,c=0,j;
cout<<"Enter the terms upto which you want to have faboncii series: ";
cin>>j;
cout<<a<<"\n";
//cout<<b<<"\n";
for (int i=0;i<=j;i++)
{
a=b;
b=c;
c=a+b;
cout<<c<<"\n";
}
getch();
return 0;
}
For any questions, query ,suggestion & output :-
Contact Me:-
0 comments:
Post a Comment