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 use of a abstract variable?
When can we say that threads are not lightweight process in java?
Explain the difference between string, stringbuffer and stringbuilder in java?
What is the output of the below java program?
Which is easier netbeans or eclipse?
Can we initialize the final blank variable?
What is the gregoriancalendar class in java programming?
What is parsing a string?
Can we convert stringbuffer to string?
How to display all the prime numbers between 1 and n (n is the number, get the input from user)
Difference between final and effectively final ?
What is meant by 'Class access modifiers'?
Define immutable object?
How do you check if a character in a string is a digit or letter?
Is null function in java?