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.
We can have a simple function to do this.
The following recursive function would do the job.
The following one works great as well!