Hi everyone, I'm struggling to write an "if else" condition for testing if an integer is a prime number or not. a prime number is a number that can only be divided by 1 and itself to give the remainder of 0; Any ideas would help.
Try checking the each possible division starting from 1 or 2 to " prime number-1 " as we know that anynumber % biggerNumber = anynumber;
and if the number gets divided , we say it is not prime , otherwise it is .