C Program to find GCD and LCM using Recursion

This C program finds the GCD (Greatest Common Divisor) and LCM (Least Common Multiple) of two numbers using recursion. Recursion is a technique where a function calls itself to solve a smaller version of the same problem. The GCD is computed with the classic recursive Euclidean algorithm, and the LCM is then derived from it …

C program to print Fibonacci numbers using Recursion

C Program to print Fibonacci numbers. In this program we used the Recursion method. Recursion is the programming technique that a process invoking itself again and again. Fibonacci numbers are sequence of numbers starts from 0 and 1 , continue by adding previous number. 0,1,1,2,3,5,8,13,…….. Read more about C Programming Language . /************************************************************ You can …

C Program to calculate factorial using Recursive function

C Program to find the factorial of a number. In this program we used the Recursion method. Recursion is the programming technique that a process invoking itself again and again. The standard recursive function for factorial is factorial=n*fact(n-1). factorial of number denoted by ‘!’, means product of all non negative integers from 1 to number. …

Array search program in C

Very often we encounter a situation where we have to search for a given target value in a list of values. Simple value types like integers are stored in arrays. This program demonstrates how to do a search within an array by using a method called linear search. Linear search, also called as ‘Sequential search’ …

C Program to demonstrate the ‘getchar’ function.

The getchar() function reads a single character from standard input (the keyboard) and returns it. It is one of the simplest input functions in C and a great way to understand how the input buffer works. In this program we use getchar() in a loop to read text entered by the user and count how …

C Program to demonstrate the ‘fgets’ function.

Program to demonstrate the ‘fgets’ function. The program will count the number of lines in a file. This is a function of the UNIX command ‘wc’. Read more about C Programming Language . /************************************************************ You can use all the programs on www.c-program-example.com* for personal and learning purposes. For permissions to use the* programs for commercial …