Count even, odd and zeroes in a given number

Q. Write a Java program to accept a number from user and count zero, odd and even digits of the entered number.  

Answer:

oddEvenZero.java

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 > 0)
          {
               if (value%10==0)
               {
                    zeroCount++;
               }
               else if (value%2==0)
               {
                    evenCount++;
               }
               else
               {
                    oddCount++;
               }
               value = value / 10;
          }
          System.out.println();
          System.out.println("Zero: "+zeroCount+"\nEven: "+evenCount+"\nOdd:  "+oddCount+"\n\n");
     }
}


Output:

zero even odd