title: initialize And Print a Array with while loop
body: <p>My project question. I have to use a double while loop.</p>
  
  <p>Write a method demoArray2 in which you:</p>
  
  <ol>
  <li><p>Use a while loop to initialize each element in the array with the following value:
  200 + 2*i
  where i is the index you use in the while loop.</p></li>
  <li><p>Use a second while loop to output the integers. See Figure 2.
  i can't seem to Initialize and print it. </p></li>
  </ol>
  
  <p>code:</p>
  
  <pre><code> public void demoArray2()
   {
       int [] intArray = new int[10];
       int index = 0;
       while (index &lt; 10) 
       {
           intArray[index] = 200 + 2*index;
       }
       int index = 0;
       while( index &lt; 10)
       {
            System.out.println("Element at index " + index + " is " + intArray[index]);
            index = index +1;
       }
  
   }
  </code></pre>
  
  <p>Any help would be much appricated</p>