Question: Write a program that prompts a user to enter an integer and the prints the sum of all the integer's digits. See examples, instructions and
Write a program that prompts a user to enter an integer and the prints the sum of all the integer's digits. See examples, instructions and starter file attached.


\fSumming the digits of an integg Write a program that prompts a user to enter an integer and the prints the sum of all the integer's digits. Example 1 Please enter an integer: 12345 The sum of the digits is: 15 Example 2 Please enter an integer: 8886 The sum of the digits is: 16 Notes: 1. Your program must include a function called sum_digits that returns [not prints) 3 sum of the digits. 2. You are not allowed to use any string functions or string operators. 3. You can use arithmetic operators and boolean operators- 4. You can not modify any code already given to you in the starter le. 5. You can add code to the starter le. 6. You can not use lists, strings, dictionaries or tuples
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
