Write a Shell Script program to find Greatest Common Divisor (GCD) for any two numbers. Ensure that your script carries out basic error checking
To write a Shell Script program to find the Greatest Common Divisor (GCD) for any two numbers, we can use the Euclidean algorithm. The Euclidean algorithm is a simple and efficient algorithm for finding the GCD of two numbers.
Here is a sample script to find the GCD of two numbers using the Euclidean algorithm:
#!/bin/bash
echo "Enter the first number:"
read _________ __________ _____ ________ _______ ___ ___ _________ _______ _________ __________ ____.
_________ ______ ______ _________ ________ __________ ____ _________ ________.
_______ _______ _______ ______ __________.
___ ___ _____ _________ ____ _________ ___ ______ __________ ______.
______ ___ _____ __________ ________ ________ __________ ____ __________ _____ ________.
__________ ________ _________ _________ __________ _______ ______ _________.
________ _____ _______ ________ __________ _________.
____ ______ ____ ____ _______ _____ _________ _________ _______ ________ ________ _____.
_____ _________ _________ _______ ___ _________ ______ _________ _________ _______ _____ _________.
______ ______ ___ ______ _________ _________ ______ _____.
______ _______ _______ ____ ___ ______ _________ _______ _______.
_______ __________ ______ __________ __________ ____ __________.
_______ ____ ____ ___ _______ __________ ____.
___ _______ ________ _________ ____ ____ _______ ________ ____ ________ ___ __________.
_________ __________ ___ ________ ________ ______ ___.
______ _________ __________ ____ ________ _____ ____ ___ ____ _______ ___.
_____ ____ _______ ____ _________ __________ _____ _________ _______ _______ ___ __________.
___ ______ _______ _____ ____ ______ _________ __________ ___ ________ _________ __________.
_______ _______ ____ ______ __________ ____ __________ __________ _____.
__________ ________ _____ __________ ______ _________ _____ __________ ____.
_____ ________ _______ _________ _________.
____ _____ _________ _______ ________ ____.
______ ______ __________ _____ ______ __________ __________ ______ _____ ___.
_________ _________ ________ ____ _________.
____ ____ ________ _______ ______ ____ ________ _______.
____ _______ _________ ________ _________ _______ ___.
________ _________ _______ _______ ________ _________.
_________ ___ ______ _____ ____ ___ _____ ___ ___.
_______ ____ ______ ___ _________.
____ ______ _____.
Get Full Answer on WhatsApp