cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
a program to compute a fibonac
a program to compute a fibonacci sequence from 100 to 1000
Mar 15, 2012 at 7:28am UTC
kob4joy
(2)
//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;
}
Mar 15, 2012 at 9:25am UTC
hamsterman
(4538)
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.