import java.util.Scanner; public class Digits { public static void main(String[] args) { int oddCount = 0, evenCount = 0, zeroCount = 0; //digit counters int value, digit; //stores input value and digit respectively int copy; //stores copy of entry Scanner scan = new Scanner(System.in); //Get value from user System.out.println(\"enter number :\"); int value=scan.nextInt(); copy=value; //Make the value positive value=Math.abs(value); //What if the value is actually zero? if(value==0) zeroCount++; while(value>0) { digit=value10; if(digit==0) zerocount++; if(digit%2==0) evenCount++; else oddCount++; value=value/10; } System.out.println(\"original value:\"+copy); System.out.println(\"zero digits :\"+zeroCount); System.out.println(\"odd digits :\"+oddCount); System.out.println(\"even digits :\"+evenCount) } } Solution import java.util.Scanner; public class Digits { public static void main(String[] args) { int oddCount = 0, evenCount = 0, zeroCount = 0; //digit counters int value, digit; //stores input value and digit respectively int copy; //stores copy of entry Scanner scan = new Scanner(System.in); //Get value from user System.out.println(\"enter number :\"); int value=scan.nextInt(); copy=value; //Make the value positive value=Math.abs(value); //What if the value is actually zero? if(value==0) zeroCount++; while(value>0) { digit=value10; if(digit==0) zerocount++; if(digit%2==0) evenCount++; else oddCount++; value=value/10; } System.out.println(\"original value:\"+copy); System.out.println(\"zero digits :\"+zeroCount); System.out.println(\"odd digits :\"+oddCount); System.out.println(\"even digits :\"+evenCount) } }.