Computer Science, asked by Adityaji, 1 year ago

write the java program for no. 5

Attachments:

Answers

Answered by adarshhoax
1
hiii friend
here is your answer
class
{psvm (int a, int b)
if (a>b)
int dividend =a;
int divisor =b;
else
int dividend =b;
int divisor =a;


int r=1;
while(r!=0)
{
r=dividend%divisor;
dividend = divisor;
divisor = r;
}
int lcm=(aƗb)/r;

sopln ("l.c.m. of" + a + "and" + b + "=" +lcm);

}


glad to help you
hope it helps
thank you.
Similar questions