Divisible by 3 and 5
You are given an integer N. Determine whether it is divisible by 3, 5, both, or neither.
Check divisibility by both numbers first, followed by divisibility by only 3 and only 5.
Input
- The input contains one integer N.
Output
Print:
- Both if N is divisible by both 3 and 5.
- Three if N is divisible only by 3.
- Five if N is divisible only by 5.
- None otherwise.
Print the result without labels or trailing spaces.
Example 1:
Input:
15
Output:
Both
Explanation:
15 is divisible by both 3 and 5.
Example 2:
Input:
7
Output:
None
Explanation:
7 is divisible by neither 3 nor 5.
Now Your Turn!
Pick the correct output for the given inputInput:
30
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- -1000000000 <= N <= 1000000000