Number dividers

Report a typo

Write a program that reads an integer number and checks if it is divisible by 2, 3, 5, or 6.

If the number is divisible by M, the program should output "Divided by M".

The program should check all the divisors listed above. The order of divisors in the result can be any.

Tip: Use the modulo operator % to check whether a number divided by another one.

Sample Input 1:

6

Sample Output 1:

Divided by 2
Divided by 3
Divided by 6
Write a program in Kotlin
fun main() {
// put your code here
}
___

Create a free account to access the full topic