0
Review My Code of Prime Number
Can i get the review of my code of prime number, in that i had checked whether the given input number is prime or not. I guess that is the fastest method to check whether the given number is prime or not. It was passed on HackerRank prime number problem. Regards Palkesh Goyal Code link: https://code.sololearn.com/ca9A23A6a10a/?ref=app
9 Answers
+ 4
Hello!
get here is the link of Palkesh Goyal prime number code
https://code.sololearn.com/ca9A23A6a10a/?ref=app
Also, Palkesh, I input 1315252 big number but it showed no ouput. Maybe you can change your code a bit and handle big numbers as well so that we can judge the speed you are talking about (fastest prime checker)
Thanks
+ 5
Now check this number - 2345673582 Palkesh Goyal
+ 4
đ Palkesh Goyal you got your review now work on it
Happy Coding đ€đ»
+ 2
Tips:
1) Your algorithm checks if number is pseudo-prime ("there is a possibility that this number is prime". For example, is says that 49 is prime (49 = 7 * 7).
2) The best way is the one that gives output in the SoloLearn C++ Playground for numbers upto 2147483647 (the highest possible number for <int> (4 bytes/32 bits). You can try to find that way, but not sure if such a way even exists.
+ 1
@Sharique Khan, i just put the number you mentioned and it gives the output
Can you please review it once again, if you have time.
Thanks for reviewing my code
+ 1
I will try to resolve the issue, and yeah 49 doesn't work in my logic, that is a loop whole in code.
Thnx for reviewing my code get
0
Hello, can you, please, give the link to your code in SoloLearn or paste the code here, so that we would be able to review your code?
0
Yeah, now its not working @Sharique Khan,
0
Yeah, thanx for your review @Sharique Khan