Answer Posted / sadikhasan palsaniya
int no=687;
int sum=0;
int temp;
while(no>0)
{
temp = no % 10;
sum += temp;
no = no/10;
}
System.out.println(sum);
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
What is an empty string in css?
Can we execute a program without main() method?
What is the difference between stored procedure & function?
Define jre i.e. Java runtime environment?
List down the methods and interfaces of collection class in java.
Can we serialize static variables in java?
Explain the difference between jdk, jre, and jvm?
How do you escape a string?
Where are global variables stored?
what are synchronized methods and synchronized statements? : Java thread
What is file in java?
Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?
What is fail fast in java?
How to invoke external process in java.
How to sort array of 0 and 1 in java?