Shell program for greatest common division (G.C.D.) Of the given three number:-
echo "Enter Number 1:-"
read a
echo "Enter Number 2:-"
read b
echo "Enter Number 3:-"
read c
gcd=1
if [ $a -ge $b ]
then
s=$a
else
s=$b
fi
if [ $s -ge $c ]
then
t=$s
else
t=$c
fi
i=1
while [ $i -le $t ]
do
d=`expr $a % $i`
e=`expr $b % $i`
f=`expr $c % $i`
if [ $d -eq 0 -a $e -eq 0 -a $f -eq 0 ]
then
gcd=$i
fi
i=`expr $i + 1`
done
echo "The GCD of $a,$b and $c is $gcd"
This solution is taken from http://bcahelper.blogspot.com
The greatest common divisor (GCD) refers to a divisor that is COMMON to two or more numbers. You have only one number in the question! The greatest divisor of any number is itself.
Yes
No. The greatest common divisor for 15 and 20 is five. Five is a prime number.
Greatest divisor of 459, apart from 459 itself, is 153. You need more than one number to have a"common" divisor.
The greatest common divisor of 9 and 11 is 1. Because 11 is a prime number.
Yes.
There is none. A greatest common divisor is the largest number that will divide into two or more given numbers without a fractional remainder.
You need at least two numbers to find a GCF.
You need at least two numbers to find a GCF. If that's 2 and 4, the GCF is 2.
The Greatest Common Divisor of two numbers is the largest number that will divide into both evenly. For example, although 27 and 81 are both divisible by 3, it wouldn't be the greatest common divisor, because 27 divides into 81 evenly as well: the greatest common divisor of 27 and 81 is 27.
117 is composite.
A single number cannot have a greatest common divisor because "common" refers to divisors that two or more numbers have in common. You have only one number.