Void main()

{

int I,sum=0,n;

System.out.print("nEnter a number:");

int n =input.nextInt();

while(n!=0)

{

I=n%10;

n=n/10;

sum=sum+I;

}

System.out.println("nThe sum=",sum);

}

{

int I,sum=0,n;

System.out.print("nEnter a number:");

int n =input.nextInt();

while(n!=0)

{

I=n%10;

n=n/10;

sum=sum+I;

}

System.out.println("nThe sum=",sum);

}