Quote
The first 12 Fibonacci numbers are:
1 1 2 3 5 8 13 21 34 55 89 144
Write a piece of code that uses a for loop to compute and print the first 12 Fibonacci numbers. (You may include other code, such as declaring variables before the loop, if you like.
I can't use any code beyond what we've learned in class. That means it can only include some of the following (just as examples):
loops, nested loops, declaring variables, and using x += (number) for sums
Similar to this:
int n = 1;
for (int i = 1; i <= 10; ++i) {
System.out.print(n + " ");
n += i + i + 1;
}