# Find LCM of Two Numbers C Program

By | December 13, 2015

## C Program To Find LCM of Two Numbers

Learn How To Find LCM of Two Numbers in C Programming Language. LCM is an abbreviated form for Least Common Multiple. This Code To Calculate LCM of Two Integers makes use of While Loop, For Loop and Modulus Operator. The Output for the program has been displayed at the bottom.

#### What is LCM?

A Least Common Multiple (LCM) of Two Integers is the Smallest Number which is a Multiple of Both the Numbers.

#### Example of LCM

The LCM of 4 and 3 is 12.

#### Formula To Find LCM of Two Integers

L.C.M = (x*y)/G.C.D

Must Read: Find LCM of N Numbers in C Programming

#### C Program To Find LCM of Two Numbers using While Loop

Note: In While Loop’s condition while(b>0), you can also use while(b!=0). However, it doesn’t work always.

#### Output

In case you find any error in the above C Program Code To Find LCM of Two Numbers or if you have any doubts, let us know about it in the Comment Section below.

## 4 thoughts on “Find LCM of Two Numbers C Program”

1. Vishal Awasti

Thanks for so many methods. Can we find LCM of 2 Numbers using Recursion in C Programming?

1. Tushar Soni Post author

Yes. Almost all the loops can be efficiently converted into Recursive functions.

2. Sugan Reddy

This is amazing man. I can now convert any For loop into While loop. Thanks for this amazing LCM program.

3. Sanjay Shukla

So basically we have to first find gcd and then lcm of the two numbers input by the user.