Question bank › Math
Dsa Math Medium

Divisibility Checker

Write a program that checks how many numbers in a given range are divisible by a specific integer. The program should read the start and end of the range, and the integer to check divisibility against. Input format: Three integers, the first line contains the start of the range (inclusive), the second line the end of the range (inclusive), and the third line the integer for divisibility. Output format: Print the count of numbers that are divisible by the given integer. Example: Input: 1 10 2 Output: 5

Key concepts

divisibilitymathmodulus

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.