title: use while loops to calculate the sum of the odd number 1-25, and even number 1-50
body: <p>i have problems with this program that i have to write. (First of all, english isnt my first language, therefore i have a hard time to understand what exactly i have to do for this program.)</p>
  
  <hr>
  
  <pre><code>Create an application Loops.java. The program must do the following:
  
  Use a while loop to calculate the sum of the odd numbers 1-25.
  
  Use a while loop to calculate the sum of the even numbers 1-50.
  </code></pre>
  
  <p>we are not adding odd number like <code>1+3+5+7+....+25,</code>
  we also not adding odd number up until the total value is <code>25</code>.</p>
  
  <p>the total value will be the sum of odd number ranging from <code>1 to 25</code>, as for even number will be from <code>1-50</code></p>
  
  <hr>
  
  <p>as for the requirement, there will be many probability,
  such as <code>(1 + 3 = 5), (1 + 5 = 7), (1 +7 = 9)</code> and so on</p>
  
  <p>I wonder, since odd number from <code>1 to 25</code> has total <code>13</code> odd numbers and even number from <code>1-50</code> has <code>25</code> even numbers, what is the limit of the while loops there is no limit for the total odd number.</p>
  
  <p>Can anyone come up with this example?</p>
  
  <p>Here is what i write at first, but after my professor explain the restriction and what i shouldn't do, I'm totally lost.</p>
  
  <pre><code>public class Loops
  {   
      public static void main ( String[] args )
      {
          int oddNumber = 1;
          int evenNumber = 2;
  
          while ( oddNumber &lt; 25 )
          {
              oddNumber = oddNumber + 2;      
          }       
          System.out.printf ( "Total sum of the odd number is %d\n", oddNumber );
  
          while (evenNumber &lt; 50)
          {
              evenNumber = evenNumber + 2;
          }
        System.out.printf ( "Total sum of the even number is %d\n", evenNumber );
      }
  }
  </code></pre>