Created
February 19, 2019 22:17
-
-
Save gayapedro/2189d07485787609a112ddaaeff353c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Fibonacci | |
| { | |
| public static int calcfib; | |
| public static void main(String[] args){ | |
| calcfib = fib(5); | |
| System.out.println(calcfib); | |
| } | |
| public static int fib(int n){ | |
| if(n<=1)return 1; | |
| return fib(n-1) + fib(n-2); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment