answersLogoWhite

0


Best Answer

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"

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Anonymous

Lvl 1
3y ago

Write a unix shell script to find the LCM of two numbers. *

This answer is:
User Avatar

User Avatar

Anonymous

Lvl 1
3y ago

15

20

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Shell script to find LCM of the given two numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp