C Program to calculate a Number raised to the Power of N using Recursion
C Program to find LCM of two Numbers using Recursion
LCM: Least Common Multiple of two numbers is the number that is a common multiple of the both the numbers.
Below is a program to find LCM of two numbers using recursion.
#include
int find_lcm(int, int); // function prototype declaration
int main()
{
int a, b, lcm;
printf("\n\nEnter 2 integers to find LCM of:\n");
scanf("%d%d", &a, &b);
lcm = find_lcm(a,b); // function call
printf("\n\n LCM of %d and %d is: %d\n\n", a, b, lcm);
return 0;
}
int find_lcm(int a, int b) // function definition
{
/*
static variable is initialized only once
for each function call
*/
static int temp = 1;
if(temp.... Show More
All Chapters — C programming
Similar Questions
From Recursive program in c · C programming
C Program to Print Binary Equivalent of an Integer using Recursion
C Program to Find Sum of Digits of a Number using Recursion
C Program to Find Sum of N Numbers using Recursion
Program to find Factorial of a Number using Recursion
Program to print Fibonacci Series using Recursion
C Program to Find Reverse of a Number using Recursion
C Program to find whether a Number is Prime Or Composite using Recursion