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

Absolute Difference Method

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read two integers, implement absoluteDifference, and print the result.

Input Format

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

  1. first integer
  2. second integer

Output Format

Print the exact report in this order:

  1. Difference

Sample Testcases

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

Sample #1
Public sample
10
4
Difference: 6
Input: first integer = 10, second integer = 4.
Key calculation(s): difference = 10 - 4 | "Difference: " + result = "Difference: 6".
Output:
Difference: 6
Sample #2
Public sample
3
9
Difference: 6
Input: first integer = 3, second integer = 9.
Key calculation(s): difference = 3 - 9 | "Difference: " + result = "Difference: 6".
Output:
Difference: 6

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