+ 8
Challenge : The Prime Search!!! (Hard)
primes are positive integers that on have 2 divisors : 1 and itseft. input any prime/es and make a code that looks for the nearest prime/es example : 4 5 8 43 => 5 5 7 43 good luck
11 Answers
+ 2
https://code.sololearn.com/cOOJQn2Fc9V6/#cpp
input numbers range 1~ 1000,000
you can input many numbers at one time
+ 2
Took some time to locate my dumb mistake but here it is:
https://code.sololearn.com/cW8cs3956os2/?ref=app
+ 2
can someone do one in java please?
+ 2
Here is my try for this challenge. You put in 1 number and it returns the nearest prime number:
please leave an upvote if you like it :)
https://code.sololearn.com/cPoYdUAD0aKV/#cpp
https://code.sololearn.com/cmnR7IPOF1G0/#cs
+ 1
https://code.sololearn.com/cEv0c8jcOpD9/?ref=app
+ 1
It works with one number but not with multiple (don't know why):
https://code.sololearn.com/WOI5RS4WWE9V/?ref=app
+ 1
Here is my try. Only one input per run, finds the nearest prime. Also the occasion where your input is at same distance to primes like 3-4-5 and the occasion where your input is already prime are included in the code.
https://code.sololearn.com/WbhTGO7SCxg1/#js
0
Rectification, this one is working now, the last one that I post, the prime number function was not completely working:
https://code.sololearn.com/WQKP52MVKYEs/?ref=app
0
Something from me : ) :
https://code.sololearn.com/cGHWVN686KXj/#java
0
My last version (you can put 400000,it still works) :
https://code.sololearn.com/WqYmHv3po8z9/?ref=app