Shell script to find LCM of the given two numbers
Sign up to join our community!
Please sign in to your account!
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
15
20
Write a unix shell script to find the LCM of two numbers. *
Shell program to find LCM and hcf of two no.s
tput clear
echo “Enter first no”
read a
echo “Enter 2nd no”
read b
p= ‘expr $a * $b’
while [$b -ne 0]
do
r= ‘expr $a % $b’
a=$b
b=$r
done
LCM = ‘expr $p / $a’
echo “LCM = $LCM”
echo “Hcf = $a”