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.
### Algorithm to Find the Highest Common Factor (HCF) of Two Numbers:
1. Input two numbers from the user:
- Prompt the user to enter two integers.
2. Initialize variables:
- Initialize two variables `num1` and `num2` to store the entered numbers.
- Initialize a variable `hcf` to store the highest common factor.
3. Find the smaller number:
- Compare `num1` and `num2` to find the smaller number and store it in a variable `smaller`.
4. Iterate from 1 to the smaller number:
- Start a loop from 1 to the `smaller` number.
___ ______ _________ ____ ________ _________ _____.
______ _____ _______ ___ ________ ________.
_________ _________ _______ ____ _______ _____ ________ _________ ___ ____ __________ _________.
__________ _________ __________ __________ ___ ______ ____ __________.
______ _________ ___ _________ ___ _______ _______.
_______ ______ _________ __________ _______ ____.
___ __________ _____ ________ ______ ________ __________ ___ _______ ___.
______ ____ _____ __________ __________ ________ _________ _____ ___ ___ ______.
______ ________ _________ ________ ________ __________ ______ ___ ____ ____ _____.
________ ____ ________ __________ ______ _________ _______ ______ ________ ________ __________ ______.
_______ ______ _______ ____ ____ _______ _______ ____ ____ __________.
_______ _________ ________ ____ _________ _____ _________ ________.
______ ________ ____ ______ ___.
________ ____ _______ _____ ___ __________ ________ _____ ________.
_____ ________ _________ ______ _______ ____.
______ _____ _______ __________ ___ ___ __________ ____.
_____ ________ _____ ___ ____ __________.
_______ ____ __________ ________ ________ __________ ____ _____ ______ _______.
_____ _________ _________ ______ ___ _____ _________ _______ _____ _____ _________.
___ ______ _______ _________ __________.
__________ __________ _______ _______ _________ ______ ________ ___ _______ _____.
___ ________ ___ _________ _______ _______ _________ ____ ______ ____ __________.
______ _____ _________ _______ ________ __________ __________ _____ _________ ____.
_______ _______ ___ ___ __________ _______ __________ _________.
_______ ___ ________ ______ ______ _________ _______.
____ _____ _______ ______ ____ ____.
__________ ____ __________ _________ _____ _______ ___ _______ ________ ____ ______.
__________ _______ _________ ______ ______ __________ ____.
_______ ________ __________ _______ __________ _________ ______ ________ ______ ____ ______.
____ _____ _____ _____ _____ ___ ___ ___ _________ ________.
____ _________ ________ ________ ____ _____ __________ __________ _____ ____ _____.
_____ __________ ___ ___ ______ ______ _____ ________ _____ _______.
_____ _______ _________ _________ ___ __________.
_______ ___ ___ __________ ___ __________ _____ ________ ______.
__________ _____ _______ _____ __________ __________ _____ ______ ________.
_______ _____ ______ _________ ___ ___ _____ ______ _________ ___ _______ ________.
________ __________ __________ ________ ________ ______ ___.
_______ __________ _________ _____ ____ ________ ________ ___ _______ ____ _____.
_______ _______ _______ _____ ___ ________.
____ ______ ____ ______ ________ _________ _____ _________ _____ _____.
_______ __________ _____ __________ ________.
______ _________ _______ __________ _____ ___ ____.
__________ _____ ______ ___ _______ ______ ______ _________ ______.
_____ _____ ___ ______ ___ _______ _________ ___.
_________ ________ ____ ______ _____ ______ _____ __________.
_______ ___ ________ ________ ____ _____ ______ ______.
______ ______ ___ __________ _________ __________ _______.
________ _______ _________ ________ ____ ___ ____ ___ ________ ______ ______.
____ ______ _____ ______ ______ ________ __________ ________ _______.
_______ ______ _________ _____ ________ _________ _______ _____.
___ ______ _____ ____ __________ _____ _______ ________ _________ _____.
_____ _________ _____ ___ ______ ___.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
✓ Unlock up to 60% of the answer
✓ No payment required