Fibonacci series using recursion

Vedant Kumar
5 min readAug 12, 2021

How to implement Fibonacci series in different languages

Welcome folks to yet another blog. Today we will be covering how to produce the Fibonacci series using recursion in four languages- C, C#, Java, and Python. Before we dive straight into implementation, it is important that we understand what the Fibonacci series is. Fibonacci series is a number series in which the next number is produced by adding the two preceding numbers. The starting of the series looks like the following: 1, 1, 2, 3, 5, 8, and so on. Also, I shouldn’t miss this point. Producing the Fibonacci series is a favorite interview question of a lot of tech companies. And we don’t want you to fizzle out at that moment and so we decided to cover this topic. So that, when this question transpires, you can have four different language implementations to impress the interviewers. We got your back on this!

Introduction

Firstly, let’s understand what recursion actually is?

Recursion

As the name suggests, recursion is the process of replicating numbers. In recursion, a function calls itself within its own function until a condition is met. The function so declared is called the recursive function. Programmers have to be vigilant while using recursion to tackle a problem. Defining the right exit condition is necessary for the entire code to work properly. Otherwise, we will forever enter the infinite loop. Talking about infinite loops, a simple infinite loop is a while(true) loop…

--

--