title: What is the most efficient way to calculate the least common multiple of two integers?
body: <p>What is the most efficient way to calculate the least common multiple of two integers?</p>
  
  <p>I just came up with this, but it definitely leaves something to be desired.</p>
  
  <pre class="lang-java prettyprint-override"><code>int n=7, m=4, n1=n, m1=m;
  
  while( m1 != n1 ){
      if( m1 &gt; n1 )
          n1 += n;
      else 
          m1 += m;
  }
  
  System.out.println( "lcm is " + m1 );
  </code></pre>