need help #java | Sololearn: Learn to code for FREE!

0

need help #java

how to get sum of digits using loop ...??

12/29/2016 3:39:04 PM

Janindu Chandopama

1 Answer

New Answer

0

int digit = 0; for (int i = 0; i <= 10; i++) { digit += i; } // digit = 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10