DEV Community

hema latha
hema latha

Posted on

LCM - Program find out least common multiple

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;                 
}}}
Enter fullscreen mode Exit fullscreen mode

out put === LCM is 1551

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more