Wednesday, December 12, 2018

SHELL SCRIPT PROGRAM TO FIND GCD OF TWO NUMBERS

PROGRAM :

echo "Enter two number"
read a
read b
while [ $a -ne $b ]
do
if  [ $a -gt $b ]
then
a=`expr $a - $b`
else
b=`expr $b - $a`
fi
done
echo "gcd=" $a

OUTPUT:



No comments:

Post a Comment

Static Member Function

CODE : #include<iostream> using namespace std; class test  {     int code;       static int count;               //static...