You are viewing a single comment's thread. Return to all comments →
this is a very simple way to check PrimeNumber static class Prime {
public boolean checkPrime(int num) { boolean isPrime = false; if (num == 2) { isPrime = true; } for (int i = 2; i < num; i++) { if (num % i == 0) { isPrime = false; break; } else if (num % i != 0) { isPrime = true; } } return isPrime; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Prime Checker
You are viewing a single comment's thread. Return to all comments →
this is a very simple way to check PrimeNumber static class Prime {