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

First Multiple Finder

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read a start value and divisor, then print the first number greater than or equal to the start value that is divisible by the divisor.

Input Format

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

  1. start value
  2. divisor

Output Format

Print the exact report in this order:

  1. First Multiple

Sample Testcases

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

Sample #1
Public sample
5
4
First Multiple: 8
Input: start value = 5, divisor = 4.
Key calculation(s): current = 5 | while (current % 4 != 0) { | "First Multiple: " + current = "First Multiple: 8".
Output:
First Multiple: 8
Sample #2
Public sample
10
3
First Multiple: 12
Input: start value = 10, divisor = 3.
Key calculation(s): current = 10 | while (current % 3 != 0) { | "First Multiple: " + current = "First Multiple: 12".
Output:
First Multiple: 12

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