title: Java nested while loops
body: <p>I need nested while loops to print so that the outter loop k  makes one decrement iteration every time that inner loop "I" finishes an iteration. K has to start at 5 and count back to 1 and I has to starts at 0 and count to 10 by 2's. So it would the out put would look like this:</p>
  
  <pre><code>K = 5 I = 0
  K = 5 I = 2
  K = 5 I = 4
  K = 5 I = 6
  K = 5 I = 8
  K = 5 I = 10
  K = 4 I = 0
  </code></pre>
  
  <p>I have been stumped for hours and tried everyway to I can think of to make it work. Can someone please help?</p>
  
  <pre><code>public class Task1 {
  public static int i = 0;
  public static int k = 5;
  
  public static void Display(){
  
      while(k &gt; 1){
  
          while(i &gt;=10){
              i = i+2;
              System.out.println("K = " + k + " I = " + i);
  
          }
  
  
          if (i &gt;= 10){
              k=k-1;
          }
      }
  }
  
  
  public static void main(String[] args) {
      // TODO Auto-generated method stub
      Display();
  
  }
      }
  </code></pre>