title: LCM (lowest common multiple) in Java
body: <p>I need help with this loop. One of my course assignments is to make a LCM program.</p>
  
  <pre><code>Sample output:
  (8,12) LCM is 24
  (4,3) LCM is 12
  (5,10,20) LCM is 20
  (18,24,52) LCM is 936
  (12,10,26) LCM is 780
  (99,63,24) LCM is 5544
  (62,16,24) LCM is 1488
  </code></pre>
  
  <p>I have this so far for 2 numbers but I'm not sure how to do 3 numbers. We're supposed to use methods on other classes so this is what I have for the LCM class.</p>
  
  <pre><code>public class LCM {
      private int n, x, s = 1, t = 1;
  
      public LCM()
      {
          n = 0;
          x = 0;
          s = 1;
          t = 1;
      }
      public int lcmFind(int i, int y) {
          for (n = 1;; n++) {
              s = i * n;
              for (x = 1; t &lt; s; x++) {
                  t = y * x;
              }
              if (s == t)
                  break;
          }
          return (s);
      }
  }
  </code></pre>