#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main()
{
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int l, r, k;
scanf("%d %d %d", &l, &r, &k);
int count = 0;
for (int i = l; i <= r; i++)
{
if (i % k == 0)
{
count = count + 1;
}
}
printf("%d", count);
return 0;
}
// You have been given 3 integers - l, r and k. Find how many numbers between l and r (both inclusive) are divisible by k. You do not need to print these numbers, you just have to find their count.
// Input Format
// The first and only line of input contains 3 space separated integers l, r and k.
// Constraints
// 1<=l<=r<=1000 1<=k<=1000
// Output Format
// Print the required answer on a single line.
// Sample Input 0
// 1 10 1
// Sample Output 0
// 10
To embed this project on your website, copy the following code and paste it into your website's HTML: