โ Back to Loops
Question 115
While Loop: Sum of Digits
While Loop: Sum of Digits
Use a while loop to add up the individual digits of the number 1234 and print the sum (1 + 2 + 3 + 4).
Expected output:
10Expected Output:
10
Topics:
Loops
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (clog, fn, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.