title: while loop - sum of even numbers and its average
body: <p><a href="http://pastebin.com/w8KntkE6#" rel="nofollow">http://pastebin.com/w8KntkE6#</a></p>
  
  <pre><code>package javaapplication9;
  
  import java.text.DecimalFormat;
  import java.util.Scanner;
  
  public class JavaApplication9 {
      public static void main(String[] args) {
          // TODO code application logic here
          {
              int sum = 0, num, count = 0;
              double average;
  
              Scanner scan = new Scanner(System.in);
  
              System.out.print("Enter an integer (0 to quit): ");
              num = scan.nextInt();
  
              while (num &gt;= 0) // sentinel num of 0 to terminate loop
              {
                  if (num % 2 == 0) {
                      count++;
                      sum += num;
                      System.out.println("The sum so far is " + sum);
  
                      System.out.print("Enter an integer (0 to quit): ");
                      num = scan.nextInt();
                  } else if (num % 2 != 0) {
                      continue;
                  }
  
                  System.out.println();
  
                  if (count == 0) {
                      System.out.println("No nums were entered.");
                  } else {
                      average = (double)sum / count;
  
                      DecimalFormat fmt = new DecimalFormat("0.###");
                      System.out.println("The average is " + fmt.format(average));
                  }
              }
  
          }
      }
  }
  </code></pre>
  
  <p>The code executes and it sums even numbers. However, when a odd number enters it returns an error or it breaks. I want it ignore any odd number. What is wrong with my code?</p>