title: How can I count the number of odd, evens, and zeros in a multiple digit number in Java?
body: <p>Basically I need to write a program that takes user input up to and including <code>2^31 -1</code> in the form of an integer and returns the amount of odd, even, and zero numbers in the int. For example,</p>
  
  <pre><code>Input: 100
  Output: 1 Odd, 0 Even, 2 Zeros // 1(Odd)0(Zero)0(Zero)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Input: 2034
  Output: 1 Odd, 2 Even, 1 Zero // 2(Even)0(Zero)3(Odd)4(Even)
  </code></pre>
  
  <p>I'm pretty sure I'm over thinking it but I can't slow my brain down. Can anyone help?
  This is the third iteration of the code, the first two were attempted with for loops.</p>
  
  <pre><code>import java.util.Scanner;
  
   public class oddEvenZero
   {
      public static void main(String[] args) {
          Scanner scan = new Scanner (System.in);
          int value;
          int evenCount = 0, oddCount = 0, zeroCount = 0;
  
          System.out.print("Enter an integer: ");
          value = scan.nextInt();
  
          while (value &gt; 0) {
  
          value = value % 10;
  
          if (value==0) 
          {
             zeroCount++;
          }
          else if (value%2==0) 
          {
             evenCount++;
          }
          else 
          { 
             oddCount++;
          }
          value = value / 10;
      }
      System.out.println(); 
      System.out.printf("Even: %d Odd: %d Zero: %d", evenCount, oddCount, zeroCount);
   }
  }
  </code></pre>
  
  <p>Sorry, the code formatted weirdly in the textbox.</p>