// This is the Hello Rusty program in Java
class HelloRusty {
public static void main (String args[]) {
String name = "Rusty";
/* Now let's say hello */
System.out.println("Hello + name");
}
}
// This is the Hello program in Java
class Hello {
public static void main (String args[]) {
int i;
System.out.print("Hello "); // Say Hello
i = 0; // Initialize loop counter
while (i <= args.length) { // Test and Loop
System.out.print(args[i] + " ");
i = i + 1; // Increment Loop Counter
}
System.out.println(); // Finish the line
}
}
The zeroth Fibonacci number is 1.
The first Fibonacci number is also 1.
The second Fibonacci number is 1 + 1 = 2.
The third Fibonacci number is 1 + 2 = 3.
In other words, except for the first two numbers each Fibonacci number is the sum of the two previous numbers. Write a program that prints the first 20 Fibonacci numbers.