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