Create program in c++
(1) Faboncy
Answers
Answered by
2
First of all it is Fibbonacci and not fabonacy. The code is (hope you know the syntax. I am writing only the logic part.)
cin>>num;
a=-1;
b=1;
for(i=1;i<=num;i++)
{
c=a+b;
cout<<c<<" ";
a=b;
b=c;
}
Hope you like it. Please mark brainliest
cin>>num;
a=-1;
b=1;
for(i=1;i<=num;i++)
{
c=a+b;
cout<<c<<" ";
a=b;
b=c;
}
Hope you like it. Please mark brainliest
Similar questions