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 java based on c?
Does treeset allow null in java?
What is set and get methods in java?
What are local variables?
23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an
What is compiler and what its output.
How will you reverse a link list without using recursion?
What is exception hierarchy in java?
What is set string?
Explain about the main() method in java?
How do you override a variable in java?
How can an object be unreferenced?
What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?
What is the applet security manager, and what does it provide?
What is tree in java?