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
Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?
How do you remove an element from an arraylist in java?
What is number data type in java?
What is an array length?
What is fail first in java?
What is a lightweight component?
Can a constructor call another constructor?
What is substring in java?
How to calculate the length of a singly linked list in java?
What is difference between string and new string?
Can a class have multiple subclasses?
What is difference between classpath and path variables in java?
Which collection is thread safe in java?
Can we restart a dead thread in java?
Which is the class in java?