Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- let number = input;
- if (number % 10 === 0) {
- console.log("The number is divisible by 10")
- } else if (number % 7 === 0) {
- console.log("The number is divisible by 7")
- } else if (number % 6 === 0) {
- console.log("The number is divisible by 6")
- } else if (number % 3 === 0) {
- console.log("The number is divisible by 3")
- } else if (number % 2 === 0) {
- console.log("The number is divisible by 2")
- } else {
- console.log("Not divisible")
- }
- }
- solve(30)
- solve(15)
- solve(12)
- solve(1643)
Add Comment
Please, Sign In to add comment