Previous Next
0 / 15
Module DEMO-33-67DEMO-OOP-33

Digit Sum Report

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read a positive integer and print the sum of its digits.

Input Format

Input is given as whitespace-separated tokens in this order:

  1. positive integer

Output Format

Print the exact report in this order:

  1. Digit Sum

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
1234
Digit Sum: 10
Input: positive integer = 1234.
Key calculation(s): value = 1234 | sum = 0 | "Digit Sum: " + sum = "Digit Sum: 10".
Output:
Digit Sum: 10
Sample #2
Public sample
9001
Digit Sum: 10
Input: positive integer = 9001.
Key calculation(s): value = 9001 | sum = 0 | "Digit Sum: " + sum = "Digit Sum: 10".
Output:
Digit Sum: 10

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings