Interview Questions

Test divisors of three

The question is as follows:
## Example

If the function call is: test_divisors(2, 10) then the output should be:
2
3
"div3"
4
5
6
"div3"
7
8
9
"div3"
10
## Solution

You will be given 2 parameters: a low number, and high number. Your goal is to print all numbers between low and high, and for each of these numbers print whether or not the number is divisible by 3. If the number is divisible by 3, print the word "div3" directly after the number.

You need to be a premium member to see the rest of this question and code.

mrdaniel
published this on 12/14/15 **|**

Login to submit a comment