GCD or HCF of two numbers
C Program to Find GCD/HCF of two Numbers.
The HCF (Highest Common Factor) or GCD (Greatest Common Divisor) of two integers is the largest integer that can exactly divide a given number without leaving a remainder.
The GCD of two numbers 8 and 12 is 4 because, both 8 and 12 are divisible by 1, 2, and 4 (the remainder is 0) and the largest positive integer among the factors 1, 2, and 4 is 4.
Mathematically, GCD can be calculated as follows:
The GCD of two numbers 8 and 12 is 4 because, both 8 and 12 are divisible by 1, 2, and 4 (the remainder is 0) and the largest positive integer among the factors 1, 2, and 4 is 4.
Mathematically, GCD can be calculated as follows:
