The document contains a Java program that calculates the sum of the digits of a given integer. It prompts the user to input a number, handles negative values, and uses a loop to extract and sum each digit. Finally, it displays the result to the user.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
15 views1 page
PGM 14
The document contains a Java program that calculates the sum of the digits of a given integer. It prompts the user to input a number, handles negative values, and uses a loop to extract and sum each digit. Finally, it displays the result to the user.