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

Even Count In Range

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read a start and end value and count the even numbers in the inclusive range.

Input Format

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

  1. range start
  2. range end

Output Format

Print the exact report in this order:

  1. Even Count

Sample Testcases

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

Sample #1
Public sample
1
10
Even Count: 5
Input: range start = 1, range end = 10.
Key calculation(s): count = 0 | for (int value = 1; value <= 10; value++) { | "Even Count: " + count = "Even Count: 5".
Output:
Even Count: 5
Sample #2
Public sample
4
9
Even Count: 3
Input: range start = 4, range end = 9.
Key calculation(s): count = 0 | for (int value = 4; value <= 9; value++) { | "Even Count: " + count = "Even Count: 3".
Output:
Even Count: 3

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