+ 2

Who can write a program in least number of steps to check if a number is prime or not??Tell me quickly and write the logic.

lets see who wins...

1st Sep 2017, 4:20 PM
Rohit Raj
Rohit Raj - avatar
4 Antworten
1st Sep 2017, 7:34 PM
Elias
Elias - avatar
0
nice try man but it will take n 'type' steps ,that means n+-k.
2nd Sep 2017, 3:39 AM
Rohit Raj
Rohit Raj - avatar
0
can anyone solve it in √n/2 steps??but the actual answer is much smaller.
2nd Sep 2017, 3:41 AM
Rohit Raj
Rohit Raj - avatar
0
This is my code, it uses only other prime numbers and the square root of n as a limit https://code.sololearn.com/cn1cz2EdhtBP/?ref=app
4th Sep 2017, 12:58 PM
Ludo
Ludo - avatar