Count Multiples of 3 in a Range
mediumQuestion 290Read two integers a and b (with a <= b) from standard input and print how many numbers in the range a to b (inclusive) are divisible by 3, with no trailing newline. For example, for the input 1 10 the multiples are 3, 6, and 9, so print the output shown in Expected Output.
Loop from a to b and count the values where i % 3 == 0.
Expected output
3= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics
Loops
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.