C Program To Find The LCM And HCF | LearntHub

Hello friends, in this post today, we will learn to find the Least Common Multiple(LCM) and Highest Common Factores(HCF) of the given numbers with the help of program.
Find LCM and HCF
Before starting the program, we need to know what is LCM and HCF.
Let's start to know about LCM and HCF.

LCM:-

The least common multiple of two or more given numbers is the smallest number that is divisible by each given number.
Example: 
6= 2×3
9=3×3
LCM= 2×3×3

HCF:-

The greatest common denominator of two or more numbers is the largest number that can divide each given number completely.
Example:
6=2×3
9=3×3
HCF= 3
Friends, we have learned that what is LCM and HCF from the definition given above, and now we will know how we can find the LCM and HCF  of  the given numbers with the help of C programs, which written bellow.
  1. Operators
  2. Array
  3. Strings
Let's know how we can find the LCM and HCF of the given numbers.
Code For LCM:-

Output:
Enter first number
8
Enter second number
16
LCM of the given number is=8
Code For HCF:-

Post a comment

1 Comments