private bool isPrime(int num)
{
if (num == 0 || num == 1)
return false;
for (int j = 2; j < num; j++)
{
if (num % j == 0) return false;
}else{
for (int i= 2; j < Math.Sqrt(num); i++)
if (num % j == 0) return false;
}
return true;
}
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
Media.Imaging | 1 | 18 | |
Python 3.5.2 32 virtualenv problems | 3 | 38 | |
VB: Convert 2 dates to specific format | 24 | 48 | |
Getting error in connectionstring with Excel. | 30 | 32 |
Join the community of 500,000 technology professionals and ask your questions.