how can we print Fibonacci series in reverse order like
55 34 21 13 8 5 3 2 1 1 0
using for loop
im just not able to figure out how to do it, please suggest me some logic to do it,
thanks
Printable View
how can we print Fibonacci series in reverse order like
55 34 21 13 8 5 3 2 1 1 0
using for loop
im just not able to figure out how to do it, please suggest me some logic to do it,
thanks
How would you do it on paper, without a computer?
by the sum of the previous two numbers
Pretend you have a really dumb friend who doesn't really understand how Fibonacci works. Write out specific instructions (full sentences, not code) on a piece of paper that your friend could follow to accomplish your goal. Remember how dumb your friend is, so make sure the instructions are as short and simple as possible. If one of the instructions can be broken down into multiple steps, do it.
When you have those instructions written out, you'll have yourself an algorithm that you can start thinking about converting to code.
ammm thats the problem even i not able to understand how can i print Fibonacci BACKWRADS
i can write a program to print Fibonacci series to Nth term no problem there
but printing it backwards is really confusing for me
lets say we have to start from 55 then next will be 34
so to print 34 we have to subtract 21 from 55, and that's the problem how can we find out what value do we have to subtract from upperbound, when the upperbound is entered by the user
Say I give you a task: starting at 55, write down the Fibonacci sequence in reverse, on a piece of paper.
How would you accomplish this task? Hint: I didn't say you can't use other pieces of paper to write whatever you want on them.
Alternatively, you might look into something called Binet's formula.
hi thx, i got it working like this :D , but in this case the user have to enter last two numbers instead of only last number