Im tryin to create a program that allows the user to input a number and it will find the corresponding fiboancci number that is that number in the sequence.
fib sequence 1 1 2 3 5 8 13 21 34
user inputs : 6
output : 8
i was wonderin if someone could help me out Thanx!!
This is loops, and this is also probably homework... so all I'm gonna tell you is that it involves one for loop inside of another for loop (if I recall from the last time I did this).. think about it.
there is no need for nested loop. A single loop would work.
lastdestined, read the Homework policy.
laserlight, sorry, I will respect the rules later.
BTW, you can delete my message, I believe that guy haven't seen it yet ;)
It's also not a very good algorithm, as it can't count beyond 100 numbers, and because it store all the unneeded intermediate numbers. You really only need to store 3 numbers at a time, and there' no need to make an arbitrary limit like that.