answersLogoWhite

0

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

13y ago

Still curious? Ask our experts.

Chat with our AI personalities

TaigaTaiga
Every great hero faces trials, and you—yes, YOU—are no exception!
Chat with Taiga
JordanJordan
Looking for a career mentor? I've seen my fair share of shake-ups.
Chat with Jordan
RossRoss
Every question is just a happy little opportunity.
Chat with Ross
More answers

[object Object]

User Avatar

Himani Patel

Lvl 2
2mo ago
User Avatar

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

User Avatar

Anonymous

4y ago
User Avatar

15

20

User Avatar

Anonymous

4y ago
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