Sum of Digits in Java


in java find digits of given number we can use modulus operator and divide it by 10 a decimal method .

 

 

output sum of digits given number of java program

e:\>javac SumDigit.java

e:\>java SumDigit

Sum of Digits of 432 is : 9

(Visited 61 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *


CAPTCHA Image
Reload Image