Count the divisible by 7 in the interval from a to b
Answers
Answered by
1
Answer:
As you have not specified the programming language to be used, I am giving the algorithm. You can implement it in any programming language.
In the given interval,
Check if the number % 7 is equal to zero. If so count it. Else go to the next number.
Explanation:
%(Modulus ) returns the remainder after dividing by 7. If the remainder is zero it means the number is divisible by 7
Similar questions
Social Sciences,
4 months ago
English,
4 months ago
English,
9 months ago
Chemistry,
9 months ago
Economy,
1 year ago