 C Programming Code Examples

C > Recursion Code Examples

C Program to Find LCM of a Number using Recursion

Program Reverse Order of Words in String - Logic to reverse the order of words in a given string. There are many Logic's to Reverse the order of words. Here is the simplest approach I am using to Reverse the order. Input a string

Program Implement a Stack by Linked List - This Program implement a stack using linked list. A Stack is a type of queue that in practice is implemented as area of memory that holds all local variables and parameters used by any

C++ Coding Add Two Numbers by Pointer - To add two numbers using pointer in the C++, you have to enter the 2 number, then make 2 'pointer' type variable of same type say *ptr1 and *ptr2 to initialize the address of both the

Finds Factorial of Number using Recursion - Declare recursive function to find factorial of a number. First let us give a meaningful name to our function, say fact(). Factorial Function accepts an integer input whose factorial is to

C Programming Add digits of the number - In "for loop" condition is first tested and then body is executed. Carefully look at semicolon at the end of 'for loop', which tells us two things for loop is bodyless. Only condition...

C++ Codes Linear Congruential Generator - C++ Program to "generate random numbers" using Linear Congruential Generator. A linear congruential generator (LCG) is an algorithm that yields a sequence of pseudo-randomized

Using Quick Sort Algorithm in C Language - 'Quicksort' is a divide and Conquer algorithm. 'Pick an element' from the array, this element is called as pivot element, divide the unsorted 'array of elements' in 2 arrays with values less

Code Passing Array to Function using Call - When we pass the address of an array while calling a function then this is called function call by reference. When we pass an address as an argument, the function declaration...