C Program to Print Fibonacci Series using Recursion

Write a C program to print Fibonacci Series using recursion. Given an input number, we have to write a code to print Fibonacci series up to that number using Recursion.

This question is very important in terms of technical interviews.

You can check my previous post for PHP script to print Fibonacci series in PHP.

What is Recursion?

In recursion, A function calls itself until the base condition is reached. Recursive code is much cleaner and shorter as compared to iterative code.
For better understanding you can my previous post on recursion and what’s the difference between recursion and iteration.

For practice, you can solve Objective Question on Recursion

PHP Script to Print Fibonacci Series

Write a PHP script to Fibonacci series in PHP. In this tutorial, We are going to write a PHP script which prints Fibonacci series from 1 to N, where N is the input integer. We are going to use both iterative and recursive approach to print Fibonacci series.

Find Missing number in Array – Programming Problem

How to find missing number in array of 1 to n. This question is generally asked in technical interviews. The problem statement is something like that. Given an array of numbers from 1 to 100. The array is sorted. One number is missing from an array. You have to find the missing number from an array. Also there is no duplicates in an array.

Count Number of Nodes in a Linked List

Write a c program to count number of nodes in a linked list. In this tutorial, We are going to write a c code to count the number of nodes in a linked list.

A linked list is a collection of nodes, each pointing to next node by means of a pointer. In linked list, each node consists of two parts, a data and a pointer to next node.

C Program to Count Number of Nodes in a Linked List

An Algorithm to Count Number of Nodes in a Linked List

i) Take a count variable and initialize it to zero, count = 0.

ii) Traverse a linked list and increment a count variable.

iii) When a node points to a null, it means we reach at end of a linked list then return the value of a count variable.

Swap Two Numbers using Call by Reference in C

How to swap two numbers using call by reference in C , C++. In the interviews interviewer generally asked the difference between call by reference and call by value. In this post let’s understand what is call by reference and how to swap two numbers using call by reference method.

C Program to Reverse a String using Stack, Pointers, Recursion & Swap

Write a c program to reverse a string without using strrev function. Given an input string, we have to write a method to reverse a string. In c, you can simply reverse a string using an inbuilt strrev() function. But we don’t have to use this method.

Think how do you solve this problem. In this tutorial, we write a c code to reverse a string using stack, pointers, recursion, loop.

Binary Search Program, Algorithm & their Time Complexity

Binary Search Program, Algorithm & their Time Complexity. In this tutorial, You’ll learn about binary search algorithm, how it’s useful in searching and the time complexity of a binary search.

Binary Search

A Binary Search is used to search an element in a sorted array.  Binary search is also known as half-interval search or logarithmic search. It works by comparing a value (value needs to search) to the middle element an array. If a value matches with the middle element then the position is returned otherwise the algorithm repeats if the value is less than or greater than the middle element.

A Binary search algorithm is efficient than the linear search algorithm. The time complexity of binary search is O(log(n)).

Find Pair of Elements in an Array whose Sum is Equal to a given number

Find Pair of Elements in an Array whose Sum is Equal to given number.  Given an array of n integers and a number x, We have to write a code to find a pair of elements(a,b) in an array whose sum is equal to a given number x.