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 meaning of variables in research?
Why local variables are stored in stack?
what is the constructor and how many types of constructors are used in java?
What are implicit objects in java?
How does callback work in java?
which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?
What is difference between path and classpath in java?
Can we call virtual funciton in a constructor ?
Is singleton class thread safe?
What are static blocks in java ?
What is linkedlist in java?
What does g mean in regex?
How do I enable java in safari?
How to print nodes of a Binary tree?
What is set and get methods in java?