Here is the code:
class Fibonacci { static final int MIN_INDEX = 1; public static void main (String[] args){ int high = 1; int low = 1; String jel; System.out.println("9: " + high); for (int i = 8; i >= MIN_INDEX; i--){ if (high % 2 == 0) jel = " *"; else jel = " "; System.out.println(i + ": " + high + jel); high = low + high; low = high - low; } } }
I want to make this program to write output numbers back. Therefore, I want not only the "i" step from the last to the first, but also the number.
In this example, the output is: 1, 1, 2, 3, 5, 8, for example ... But I want to show it in a sequence, for example: eg ..., 8, 5, 3, 2, 1, 1.
I tried to change the high and low, but I can not get this program to work "back".
source share