0

How to find a number is prime number or not

11th Mar 2019, 3:03 AM
M.Santhosh Kumar
4 Respostas
+ 1
75/2 = 37.5 or 75%2 = 1 so continue testing 75/3 = 25 or 75%3 = 0 so testing complete 75 is not a prime number Try 11 Square root of 11 is 3.32 so we only need to test up to 3. 11/2 = 5.5 or 11%2 = 1 so continue 11/3 = 3.6666667 or 11%3 = 1 No whole number results. Therefore 11 is a prime number.
11th Mar 2019, 1:43 PM
Mike
Mike - avatar
0
For numbers that aren’t too big, the simplest way is to try dividing the number by everything from 2 to the square root of the number and see if the result is a whole number. If a test along the way results in a whole number, stop the test because it’s not a prime number.
11th Mar 2019, 5:26 AM
Mike
Mike - avatar
0
If n=75 is prime number or not
11th Mar 2019, 6:40 AM
M.Santhosh Kumar