Return true if the given non-negative number is a multiple of 3 or a multiple of 5





Test cases:

Test cases Expected Result
or35(15) true OK
or35(8) false OK
or35(12) true OK

Java solution:

public class Program4 {
	public static void main(String[] args) {
		Program4.or35(15);
		Program4.or35(8);
		Program4.or35(12);
	}
	
	public static boolean or35(int n) {
		if (n % 3 == 0 || n % 5 == 0) {
			return true;
		}
		return false; 
	}

}

Javascript solution:

const or35 = (num) => {
    if (num % 3 === 0 || num % 5 === 0) {
        return true;
    }
    return false;
}

console.log(or35(15)); //true
console.log(or35(8)); //false
console.log(or35(12)); //true

 

Our Best Partners: kazoom casino bonus mines jogo nyt dansk online casino fishin frenzy megaways online casino mit google play মেলবেট ক্যাসিনো https://uusinnettikasinot.com/ jogo de mina aposta crazy time app download apk crazy time play demo

Bushan Sirgur

Hey guys, I am Bushan Sirgur from Banglore, India. Currently, I am working as an Associate project in an IT company.

Leave a Reply