public class Primes { public static boolean isAPrime(int number) { for (int i=2;i*i<=number;i++) { if (number % i == 0) return false; } return true; } }
- public class Primes {
- public static boolean isAPrime(int number) {
- for (int i=2;i*i<=number;i++)
- {
- if (number % i == 0)
- return false;
- }
- return true;
- }
- }