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 singleton class example?
What does singleton mean in java?
what state does a thread enter when it terminates its processing? : Java thread
How many bytes is a string in java?
Explain the overview of UDP messaging.
What is a function in java?
What are the different http methods?
When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?
Can extern variables be initialized?
What is default size of arraylist in java?
How do you avoid global variables?
What is the benefit of inner classes in java?
What are 3 boolean operators?
Do I need java on my computer?
What are the features of junit?