Guys help naman ohhh.... pki gawa naman ako ng programm...
Activity namin to sa skul.. di ko magawa ehh.. ang hirap...
Write a complete C program that will display the highest common factor of two numbers.
The highest common factor (HCF) of two positive integers a and b is the largest integer that
divides each of a and b exactly. For example, the HCF of 45 and 30 is 15.
Here is a form of Euclid's algorithm for finding the HCF of two integers. Let's say we want
to find the HCF of 36 and 90.
· Write down the numbers: 36 90
· ... and also write down their difference: 36 90 54
· Form a "number chain" by repeatedly writing down the difference between the last
two numbers, stopping when you get to zero. The last non-zero number is the HCF:
· 36 90 54 36 18 18 0
· The HCF of 36 and 90 is 18. (tip: use absolute value)
Example:
Input: 30 45
Output: 15