package day1;
public class LCM {
public static void main(String[] args) {
// TODO Auto-generated method stub
int no1 = 3;
int no2 = 517;
int big = 0;
if (no1>no2)
big = no1;
else
big = no2;
while(true) {
if(big%no1==0 && big%no2==0)
{
System.out.println("LCM is " +big);
break;
}
big= big+1;
}}}
out put === LCM is 1551
Top comments (0)