Count Divisible by K in Range Problem
Count Divisible by K in Range Problem — ExecCode School DSA Practice
Solve the Count Divisible by K in Range problem on ExecCode. Free online school DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Given three integers A, B, and K, count how many numbers between A and B (inclusive) are divisible by K. Your task is to understand the rule and print the correct answer. You are working on Count Divisible by K in Range.
Examples
Input 6 11 2; Output 3. Input 1 10 1; Output 10
Constraints
1<=A<=B<=10^9
Practice Count Divisible by K in Range free on ExecCode. Browse DSA problems, topic map, and placement guides.