title: 2 counters in one for loop?
body: <p>My output is coming wrong and I realised the reason that I am running "for loop" for "k" a value of "for loop" of j.. </p>
  
  <p>Running for loops for "j and k" simultaneously would solve my problem. How to do that?</p>
  
  <pre><code>public void yestimatedvalue() {
      for (int i = 1; i &lt; bmarray.length; i++) {
          double g = 0;
          s = i;
          int p = missingrowcolindex(s);
          System.out.println("p::\t" + p);
  
          for (int j = 0; j &lt; bmarray[i].length; j++) {
              if (j != p) {
                  g = arraybeta[0][p];
  
                  for (int k = 1; k &lt; arraybeta.length; k++) {
                      g = g + ((bmarray[i][j]) * (arraybeta[k][p]));
  
                  }
  
              }
          }
           System.out.println("g::\t" + g);
      }
  }
  </code></pre>
  
  <p>output::</p>
  
  <pre><code>g:: 23.99999999999998
  
  g:: 4.9999999999999964
  
  g:: 5.999999999999995
  
  g:: 1.0
  </code></pre>