Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions


class DigitSum
public static void main(String args[])
int i,a=0, sum=0; i=Integer.parseInt(args[0]);
//choose you integer
(i!=0) { a=i%10; i=i/10; sum=sum+a;
Hope it helps you out (:
2 5 2
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts