- C program to test if a number is a power of 2
- C program to multiply two number without using multiplication(*) operator
- C program to display Fibonacci series
- C program to compare two numbers without using relational operators
- C program to convert roman number into decimal number
- C program to encrypt and decrypt the string
- C program to make calculator using switch case
- C program to convert temperature from degree celsius to fahrenheit
- Selection sort in C programming
- Binary search in C programming
- C program to sort array using bubble sort algorithm
- Linear Search in C Programming – Program and Explanation
- C program to swap two numbers
- C program to find LCM of two numbers
- C program to find GCD of two numbers
- C program to find LCM and GCD using recursion
- C program to display prime numbers between two numbers using function and without using function
- C program to check whether a string is palindrome or not
- C program to read a character from keyboard and print it in reverse case i.e if input is lower case output will be upper case and vice versa
- C program to check whether a number is prime or not
- C program to check whether a number is positive, negative or zero
- C program to check whether a number is palindrome or not
- C program to check leap year
- C program to check Armstrong number
- C program to calculate the area of square with and without using function
- C program to calculate mean using arrays
- C program to calculate area of circle

C program to find LCM and GCD using recursion of two integers entered by the user.

Please go through following C programming articles to understand the concept of the program.

We have use following formula to find the LCM of two numbers using GCD

LCM = (number1 * number2) / GCD

Visit this page to learn how to calculate GCD using loops

```
#include <stdio.h>
int gcd(int x, int y); //function prototype
int main()
{
int num1, num2, hcf, lcm;
printf("Enter two integer Values:\n");
scanf("%d %d", &num1, &num2);
hcf = gcd(num1, num2);
printf("GCD: %d", hcf);
printf("\nLCM: %d", (num1 * num2) / hcf);
return 0;
}
//recursive function
int gcd(int x, int y)
{
if (y == 0) //recursion termination condition
{
return x;
}
else
{
return gcd(y, x % y); //calls itself
}
}
```

[adsense1]

**Output**

Visit this page to learn how to calculate LCM using loops

**Explanation**

In the above program, recursive function `gcd`

returns the value of gcd. The termination condition of the recursive function is `y == 0`

which checks whether the number is equal to zero or not.