Fibonacci Series using recursive function and non-recursive function
Here, the next number is the sum of previous two numbers. The first two numbers are always 0 and 1.
- Fibonacci series can be achieved in two ways:
- Recursive
- Non-recursive
- A method which keeps calling itself is called recursive
- Assuming you want to use non-recursive, while in the directory in CLI, type:
- javac FibonacciSeries.java
- java FibonacciSeries
- Follow the instructions