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
Is there is any difference between a scrollbar and a scrollpane?
What is a parameter in simple terms?
What are the library functions in java?
Is integer a class?
When should we create our own custom exception classes?
What is a file pointer?
What is parse method?
What is the common usage of serialization? What exceptions occur during serialization?
What is passing by reference in java?
how is final different from finally and finalize in java?
What is the purpose of default constructor?
What is main string [] args?
What is the meaning of 3 dots in java?
Explain the significance of listiterator.
Is it possible for yielded thread to get chance for its execution again ?