For example, the GCD of two numbers, 8 and 12 are 4 because factors for 8 are 1,2,4,8 and factor for 12 are 1,2,3,4,6,12, largest comman factor is 4. GCD is also called HCF (Highest Common Factor). The Greatest Common Divisor (GCD) or Highest Common Factor (HCF) of a given integer is the highest positive integer that divides the given integer without remainder. In this program, you will take two numbers from the user and finding the GCD of two numbers. Example: Lets say 2 numbers are 36 and 60. This is a C program to find GCD of two numbers. So GCD of 2 numbers is nothing but the largest number that divides both of them.
0 Comments
Leave a Reply. |