Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Fibonacci number 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
Rextester
Basic LinkedList in Java
Equal_HashCode_TEST --- imporatnt concept about hashing
Random and count of even numbers (ver. 2)
Triangle
problem 11: java program 11
Simple imitation for show banners on priorities
sfr
Multiplying Two Base-36 Numbers
1