+ 1

Number of ways to write a program of prime number

Number of ways to write logic of prime number

17th Oct 2017, 6:06 PM
Aftab Ansari
Aftab Ansari - avatar
2 odpowiedzi
+ 1
there are as many ways as prime numbers exist
17th Oct 2017, 6:16 PM
Oma Falk
Oma Falk - avatar
+ 1
you can check the result of the given number modulu each number below it untill you reach the number 2 and check if every single result doesnt equal to 0.( in this case the number is prime). however, this logic doesnt work for number 2 which is the only even prime number.
17th Oct 2017, 6:18 PM
WildGeese
WildGeese - avatar