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
Where is jre installed?
How we create object in copy constructor?
Is static a keyword in java?
Why is string class considered immutable?
Which is better singleton or static class?
What do you mean by hashing?
How to create an immutable class?
What is advantage of java?
What is the difference between applet and application?
Write a java program that prints all the values given at command-line.
How will you initialize an Applet?
What is a final class in java?
What's the purpose of using break in each case of switch statement?
What is the disadvantage of synchronization?
What is a static class in java?