# fibonacci series in reverse order

• July 17th, 2013, 08:10 AM
r2dak
fibonacci series in reverse order
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
• July 17th, 2013, 08:19 AM
KevinWorkman
Re: fibonacci series in reverse order
How would you do it on paper, without a computer?
• July 17th, 2013, 08:29 AM
r2dak
Re: fibonacci series in reverse order
by the sum of the previous two numbers
• July 17th, 2013, 08:31 AM
KevinWorkman
Re: fibonacci series in reverse order
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.
• July 17th, 2013, 08:42 AM
r2dak
Re: fibonacci series in reverse order
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
• July 17th, 2013, 08:57 AM
KevinWorkman
Re: fibonacci series in reverse order
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.
• July 17th, 2013, 10:06 AM
r2dak
Re: fibonacci series in reverse order
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

Code Java:

```  class fibo_r {   public static void main(String args[]) { int a=89,b=55,c,d,i; System.out.println(+a); System.out.println(+b); for(i=a;i>1;i=i-c) { c=a-b; System.out.println(+c); a=b; b=c; } }   }```