0
How to pribt fibonacci series n terms in c++?? I have donw certain steps but dont know what to do after that
c++
8 ответов
+ 8
#include<iostream>
int main()
{
int i,no, first=0, second=1, next;
clrscr();
first=0;
second=1;
cout<<"Enter number of terms for Series: ";
cin>>no;
cout<<"Fibonacci series are: \n";
for(i=0; i<no; i++)
{
cout<<"\n"<<first;
next = first + second;
first = second;
second = next;
}
return 0;
}
0
oops its not pribt it is print
0
What steps have you done? Are you familiar with the Fibonacci algorithm?
0
i know it
0
its like
0
0 1 1 2 3 5 8 13 21 34
0
right
0
thanks PR now i can understand better with the. help of the code thanks a lot m8