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 write this program, to store the Fibonacci sequence in an array, and then write out them. But I can't write it. What can I do? I don't need to "mark them" with an *.
9: 1 8: 1 7: 2 * 6: 3 5: 5 4: 8 * 3: 13 2: 21 1: 34 *Is this what you want?