Write an algorithm to find the HCF (Highest Common Factor) of the two numbers entered by a user. Transform your algorithm to a C program, support your program with suitable comments.
Algorithm to find the HCF of two numbers:
1. Start
2. Input the first number (num1) from the user
3. Input the second number (num2) from the user
4. Set minNum as the minimum of num1 and num2
5. Initialize a variable hcf to 1
6. Iterate from 1 to minNum:
a. ________ ____ _______ _______ __________ __________ _________ ____ __________ ________ ________ _______.
_______ _______ ___ ____ ________ ___.
_____ _______ ___ _____ ____ ____ ______ ______ ______ _______.
______ _______ _____ ___ _______ __________ ________ ____ ________ ______ _______ __________.
__________ _______ ________ ____ __________ ________ ______ __________ ________ __________ _______.
____ ______ __________ _____ _______ __________ _____ _______.
___ _____ ____ ______ ______ __________.
______ ____ _____ ______ ___ ______ ________ ____ ____ _________ ________.
____ ________ ______ ___ ___.
____ _________ ____ ______ _______ ________ _____ _______.
_______ _____ ___ ________ ____ _______ _____ _________ _____ ___.
_____ _______ _________ ______ _____ _____ _____ _______ _________.
________ __________ ____ _________ ________ ____ _________ _________ ______ __________ _________.
____ _______ ___ __________ __________ ________ ______ __________ _________.
__________ ____ ____ __________ _____ ______ __________ _____ _____ _______ _____ ________.
__________ ________ ____ ______ _________ _________ ________ ________.
_________ ________ _______ _________ _________.
______ ___ ________ _____ __________ ____ ______ ______ _____ ____ ______.
_____ _________ ___ ___ ___ _________ ____ ________ _________ _____.
___ __________ ____ ________ _____.
_______ ______ ____ ________ _________ _____ ___ ___ ___.
_______ _________ _____ ____ ____ ________ __________ __________ _________ _______ ____ _______.
______ _______ ___ ____ ______ __________ ___ _________ __________.
______ ___ ___ _________ _____ _________ ____ _________ _____ _____.
_____ __________ ________ _____ ____ ______ __________ __________.
_______ ___ _____ _____ ____ _________ ____ ____ ____ ________ ____.
____.
Get Full Answer on WhatsApp