title: Write a program that reads a set of integers and prints the sum of the even and odd integers
body: <p>This is what I have so far. I am supposed to write this code with a <code>For</code> loop and <code>if/else</code> statement, but /i am stuck on how to do it properly. It would be nice if someone can tell me how to properly use a <code>For</code> loop and <code>if/else</code> statement together instead of giving the answer:</p>
  
  <pre><code>import java.util.*;
  
  public class SumEvenOdd
  {
      public static void main(String []args)
      {
          Scanner keyboard= new Scanner(System.in);
  
          int counter;
          int i= 0;
          int num=0;
          int sumOdd= 0;
          int sumEven= 0;
  
          System.out.println("Enter integers other then Zero: ");
          num=keyboard.nextInt();
  
          System.out.println("The numbers you entered are: ");
  
          for (i =num; i !=0; i=i)
                  {
                      if (i % 2 == 0)
                          sumEven = sumEven + i;
                      else
                          sumOdd = sumOdd + i;
                      i = keyboard.nextInt();
                  }
          System.out.println("Even sum: " + sumEven);
          System.out.println("Odd sum: " + sumOdd);
      }
  }
  </code></pre>