The Divisibility Scanner

MediumAcc. 91.4%
+30 XP 12

Range Scanning

Nested loops are the engine of data analysis. By cycling through a list of targets and checking each against a list of rules (like divisors), you can find complex patterns.

The Assignment

Your function receives parameters startRange, endRange, minDivisor, and maxDivisor.

  1. Write an outer for loop (target) that cycles from startRange to endRange.
  2. Write an inner for loop (divisor) that cycles from minDivisor to maxDivisor.
  3. Inside the inner loop, check if target % divisor === 0.
  4. If true, print: "Target " + target + " is divisible by " + divisor

01EXAMPLE 1

Inputstart=10, end=12
OutputTarget 10 is divisible by 2 Target 12 is divisible by 2 Target 12 is divisible by 3

Explanation: Checks each number against 2 and 3.

Constraints

  • Use nested for loops.
  • Correct string formatting for the log.
LoopsFundamentalsMath
JavaScript
Loading...
3 Hidden

Input Arguments

startRange10
endRange12
minDivisor2
maxDivisor3

Expected Output

Target 10 is divisible by 2
Target 12 is divisible by 2
Target 12 is divisible by 3

Click RUN to test your solution