How to pribt fibonacci series n terms in c++?? I have donw certain steps but dont know what to do after that | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to pribt fibonacci series n terms in c++?? I have donw certain steps but dont know what to do after that

c++

31st Aug 2017, 5:53 PM
Mohit Krishnan
Mohit Krishnan - avatar
8 Answers
+ 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; }
31st Aug 2017, 6:16 PM
P R
P R - avatar
0
oops its not pribt it is print
31st Aug 2017, 5:53 PM
Mohit Krishnan
Mohit Krishnan - avatar
0
What steps have you done? Are you familiar with the Fibonacci algorithm?
31st Aug 2017, 6:15 PM
vvvvv
vvvvv - avatar
0
i know it
31st Aug 2017, 6:21 PM
Mohit Krishnan
Mohit Krishnan - avatar
0
its like
31st Aug 2017, 6:21 PM
Mohit Krishnan
Mohit Krishnan - avatar
0
0 1 1 2 3 5 8 13 21 34
31st Aug 2017, 6:21 PM
Mohit Krishnan
Mohit Krishnan - avatar
0
right
31st Aug 2017, 6:21 PM
Mohit Krishnan
Mohit Krishnan - avatar
0
thanks PR now i can understand better with the. help of the code thanks a lot m8
31st Aug 2017, 6:23 PM
Mohit Krishnan
Mohit Krishnan - avatar