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
Related questions

Shell script to find amstrong numbers within a given range?

Check below link


Shell script to find out the sum of first 10 natural numbers?

Yes


Write a Shell program to find the smallest number from a set of numbers?

k


Shell program to find the smallest digit of a given number?

syntax error


How do you find the average of three numbers using vb script?

Add the numbers, then divide by three. I don't know vb script, but in most programming languages it would be something like this: result = (a + b + c) / 3


How can you find the GCF of a given set of numbers given their LCM but without listing the factors of the numbers?

By finding their common prime numbers.


How do you find the numbers given the gcd and lcm?

if the gcd and lcm are given and one of the numbers are also given,multiply the gcd and lcm and divide them by the given number


How do you find repeating number from the given 5 numbers?

By first GIVING the numbers!


Shell program to find the sum of cube of individual digits of a number?

Shell problems are programs that can be run to find out information about numbers. The problem can help find an even or odd number, or what the sum of a cube is.


How do you draw a flowchart of HCF of two given numbers?

draw a flow chart to find hcf of two given numbers


How to find ratio between three numbers when their ratios are given?

Their given! You found it! Boom


How do you find a pair of numbers when the GCF is given?

To find a pair of numbers with a given GCF, take the GCF number and double it. The pair of numbers is the GCF, and two times the GCF. For instance, two numbers with a GCF of 3 are 3 and 6.