Finding LCM using GCD is explained here but here the task is to find LCM without first calculating GCD.
Input: 7, 5 Output: 35 Input: 2, 6 Output: 6
The approach is to start with the largest of the 2 numbers and keep incrementing the larger number by itself till smaller number perfectly divides the resultant.
LCM of 5 and 7 is 35
- Program to find LCM of two numbers
- Program to find GCD or HCF of two numbers
- Program to find sum of prime numbers between 1 to n
- Program to find first N Fermat Numbers
- Program to find LCM of two Fibonnaci Numbers
- Program to find first N Iccanobif Numbers
- Program to find sum of first n natural numbers
- Program to find the percentage of difference between two numbers
- Program to find GCD of floating point numbers
- Program to find the common ratio of three numbers
- C program to Find the Largest Number Among Three Numbers
- Program to find GCD or HCF of two numbers using Middle School Procedure
- Program to find HCF (Highest Common Factor) of 2 Numbers
- Program to find the maximum difference between the index of any two different numbers
- Program to find count of numbers having odd number of divisors in given range
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.