In: Computer Science
//Java Language
Read an integer number from the user. If the number is not positive, change its sign.
  
1   Count the digits of the number
2   Count the odd digits of the number
3   Calculate the sum of the digit values of the
number
Code:
import java.util.*;
class dig{
   public static void main(String args[]){
       Scanner s=new
Scanner(System.in);
       System.out.print("Enter
number:");
       int
n=s.nextInt(),sum=0,od=0,t=0,r;
       if(n<0){
           n=-n;
       }
       while(n>0){
           r=n%10;
           sum=sum+r;
           t=t+1;
          
if(r%2==1){
          
    od=od+1;
           }
           n=n/10;
       }
       System.out.println();
       System.out.println("Count of digits
of number is "+t);
       System.out.println("Count of odd
digits of number is "+od);
       System.out.println("Sum of digits
of number is "+sum);
   }
}
Output:
