help please if u can
hello everybody....i have a question about the following code...its about fibonacci series...
# include <iostream.h>
# include <conio.h>
int main()
{
clrscr();
int n,i,c;
int a=0;
int b=1;
cout<<"Enter number of terms:";
cin>>n;
cout<<"\n"<<a<<""<<b;
for(i=2;i<n;i++)
{
c=a+b;
cout<<""<<c;
a=b;
b=c;
}
getch();
}
my question is in the part of :
for(i=2;i<n;i++)
{
c=a+b;
cout<<""<<c;
a=b;
b=c;
}
i couldnt get the logic of this part....so can any pne explain to me please...?
Note: sorry if the question may look stupid..but im a beginner in c++.
|