Write an algorithm to find the HCF (Highest Common Factor) of the two numbers entered by a user. Transform your algorithm into a C program, support your program with suitable comments
To find the Highest Common Factor (HCF) of two numbers, we can use the Euclidean algorithm. The algorithm is based on the property that the HCF of two numbers is equal to the HCF of the remainder of the division of the larger number by the smaller number, until the remainder becomes zero. The last non-zero remainder is the HCF of the two numbers.
Here is the algorithm to find the HCF of two numbers:
Read the two numbers from the user and store them in variables num1 ___ _______ __________ _________ ____ __________.
____ ___ ______ _____ ____ ___ __________ _________ ___ ______ _____.
________ _____ __________ ___ __________ _______ ___ ________.
_______ _______ _____ ________ _____ _____.
_____ _____ ___ ________ ___ ______ ________ ___.
__________ ___ ____ _____ ______ ___.
___ ______ _______ ________ ____ _____ ___ _________ ________.
_________ _____ ___ ___ _______ ________ ______ __________.
____ _____ _________ _____ ____.
__________ _________ __________ _______ ____ __________ _______ ___ __________ _______.
____ ____ ______ _____ __________ ____ ___ _______ ______ _______.
_____ _______ _____ ________ _____ ____ _____ ___.
___ ____ ________ _______ ________ ____ ____.
_____ ___ __________ _________ ______ ________ _________.
_______ ________ ___ ____ ___ __________ ______ ____ ______ ___ _________ _________.
_______ ____ ___ ______ __________ _______ __________ __________ _________ _______.
_________ ________ __________ ________ ____ ______.
_______ ___ ________ ___ _____ ____ ______ _________ ________.
______ _______ ______ _______ __________ _____.
____ _____ ____ ________ _______ ________.
_____ _____ _________ _________ _________ ___ ________ ________ ______ ________ __________ _____.
______ _________ __________ ____ _______ _______ _____ ___.
____ _____ ______ _______ _________ __________ ____ ___ ___ ___ ___.
____ _______ __________ ___ ____ ___ ____.
_____ __________ _____ ____ __________ _______ _________ _________ _________.
_________ ________ ______ ___ _______.
________ ______ _____ __________ __________ _________ ____ __________ ____.
___ _______ ___ __________ _______ ______ ___.
_______ ______ _______ __________ _________ ______ _________ __________.
_______ ___ _________ ______ ____ _______ ________ __________ __________ ________ ________ _____.
_________ _____ _____ _________ __________ _________.
_____ __________ ________ ___ _____ ___ _______ ______.
___ ________ _________ _____ ______.
____ _____ ______ ______ _________ ________ ________.
__________ ______ __________ __________ _______ ______ ____ _______ ________ ____ ____.
____ __________ _____ _________ ___.
_________ _______ ___ ___ ________ _____ _______ ______.
_____ _____ ______ ____ _________ _____ ______ __________ _______ ______.
___ _________ __________ ______ ______ _______.
_______ ________ _________ ________ _________ _______ __________ __________ __________ ______ ________ ______.
__________ ____ ________ ________ ___ ________ _____ _____ ________ _______ _____.
_______ ___ ____ ________ ____ _________ ______ ______ ________ ___ _____ _____.
_________ ______ __________ _______ _______ _______ _____.
Get Full Answer on WhatsApp