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 are parsing rules?
What is a method declaration?
Can we override data members in java?
What is the use of conditional statement?
when should you use stringbuilder class in a program?
Is there a way to increase the size of an array after its declaration?
Write a program to print the pattern given below
What is the difference between an inner class and a sub-class?
What is java life cycle?
Why java is not 100% object-oriented?
What is a classloader in java?
What is the purpose of file class?
What is diamond operator in java?
Difference between static synchronization vs. Instance synchronization?
Explain the private protected method modifier?