Know if is prime number

public static boolean esPrimo(int n){ boolean esPrimo = true; for (int i =2; i < n && esPrimo; i++){ if(n % i == 0){ esPprimo= false; } } return esPrimo; }
know if a int is a prime number. Return boolean

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.