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
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
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?
Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
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.
Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
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.
Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
hi thx, i got it working like this , but in this case the user have to enter last two numbers instead of only last number