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

Even Counter Method

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read five integers, implement countEven that receives an array, and print the number of even values.

Input Format

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

  1. value 1
  2. value 2
  3. value 3
  4. value 4
  5. value 5

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
2
3
4
5
Even Count: 2
Input: value 1 = 1, value 2 = 2, value 3 = 3, value 4 = 4, value 5 = 5.
Key calculation(s): count = 0 | if (value % 2 == 0) { | "Even Count: " + result = "Even Count: 2".
Output:
Even Count: 2
Sample #2
Public sample
2
4
6
8
10
Even Count: 5
Input: value 1 = 2, value 2 = 4, value 3 = 6, value 4 = 8, value 5 = 10.
Key calculation(s): count = 0 | if (value % 2 == 0) { | "Even Count: " + result = "Even Count: 5".
Output:
Even Count: 5

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