Answer Posted / sai
int num=687;
int sum=0;
int i;
System.out.println(num);
for(i=num;(sum>=0)&&(i>0);){
//System.out.println(i);
i=num%10;
System.out.println(i);
sum+=i;
//System.out.println(sum);
num/=10;
//System.out.println(i);
}
System.out.println(sum);
Is This Answer Correct ? | 10 Yes | 7 No |
Post New Answer View All Answers
What is the difference between static and non-static variables in java programming?
Why we use multi threading instead of multiprocessing?
Can a final variable be null?
Can a class be final?
Can we have more than one package statement in the source file?
What are the advantages of java inner classes?
Explain java coding standards for interfaces?
What isan abstract class and when do you use it?
What is the byte order of byte buffer?
What is a native method in java programming?
How many types of design patterns are there?
What do you mean by scope of variable?
What is string and its types?
What is hash code collision?
What do you mean by constructor?