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

Sum Five Numbers

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read five integers, store them in an array, and print their sum.

Input Format

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

  1. first number
  2. second number
  3. third number
  4. fourth number
  5. fifth number

Output Format

Print the exact report in this order:

  1. Sum

Sample Testcases

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

Sample #1
Public sample
1
2
3
4
5
Sum: 15
Input: first number = 1, second number = 2, third number = 3, fourth number = 4, fifth number = 5.
Key calculation(s): values = {1, 2, 3, 4, 5} | sum = 0 | "Sum: " + sum = "Sum: 15".
Output:
Sum: 15
Sample #2
Public sample
10
0
10
0
10
Sum: 30
Input: first number = 10, second number = 0, third number = 10, fourth number = 0, fifth number = 10.
Key calculation(s): values = {10, 0, 10, 0, 10} | sum = 0 | "Sum: " + sum = "Sum: 30".
Output:
Sum: 30

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