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 mechanism does java use for memory management?
What is a linkedhashmap java?
Difference between static binding and dynamic binding?
Is call by reference possible in java?
Explain about fail safe iterators in java?
What is difference between public static and void?
What is the difference between an object-oriented programming language and object-based programming language?
What is the gregoriancalendar class in java programming?
Explain how to convert any java object into byte array.
Difference between this() and super() ?
What does function identity () do?
Does hashset allow duplicates in java?
What are sets in java?
How can I debug the Java security exceptions and AccessControlExceptions?
How to use arraylist in java netbeans?