Answer Posted / asit
public class addDigit {
public static void main(String args[])
{
int num=56782;
int sum=0;
while(num!=0)
{
sum=sum+num%10;
num=num/10;
}
System.out.print(sum);
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the covariant return type?
What is linkedlist in java?
what are different ways in which a thread can enter the waiting state? : Java thread
What is the difference between this() and super() in java?
What is bubble sort in java?
What is a numeric format?
What is method with example?
What is the difference between an inner class and a sub-class?
How variables are declared?
can used Protected Class outside Function.?
What is the Concept of Encapsulation in OOPS
Can we override the static methods?
What are parsing rules?
What is byte code and why is it important to java’s use for internet programming?
What are the data types supported by java?