Problem:
Generating Fibonacci series using only one variable.
There are many ways to achieve this. I have given three ways to do this in the following methods.
Method #1:
We can have a simple function to do this.
Method #2:
The following recursive function would do the job.
Method #3:
The following one works great as well!
Cheers!!
Jack