a program to compute a fibonacci sequence from 100 to 1000

//program to display fibonacci between 100 and 1000
#include <iostream>
using namespace std;
int main()
{ int a(0), b(1), c, num, n(2); cout<<"enter the fibo number here: "; cin>>num;
while(n<=num){ c=a+b; a=b; b=c; n++;
if(c>=100 && c<=1000){ cout<<c<<endl; }
}
system("pause");
return 0;
}
If you know that you want numbers from 100 to 1000, what is the input for?
Also, state the purpose of your thread. Did you want comments?
Lastly, use proper formatting and [code] tags.
Topic archived. No new replies allowed.