Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
// Java Coding Challenge - 06: Print out Fibonacci numbers 0 - 93
//Title of this code //'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_45 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int max = 93; long fibonacci = 0; //BigInteger fibonacci = BigInteger.ZERO; long fibonacci2 = 1; //BigInteger fibonacci2 = BigInteger.ONE;D System.out.println(1 + ": " + fibonacci); for (int i = 2; i <= max; i++) { fibonacci = fibonacci + fibonacci2; //f = f.add(f2); fibonacci2 = fibonacci - fibonacci2; //f = f.subtract(f2); System.out.println(i + ": " + fibonacci); } } }
run
|
edit
|
history
|
help
0
Compiler
Three In A Row Solver
Simple imitation for show banners on priorities
Test
4.d
Sqrt
th
ok
Rotate matrix clockwise
pow x^n