+ 4
<<Challenge!>> : Prime numbers !
Make a program (any language) for finding prime numbers from 1 to given X and print them in list. Hint: the prime numbers are divided by 1 and themselves. (I added my version in python, please try it before you see the solution...) https://code.sololearn.com/cBs771u9MOht/?ref=app
6 Answers
+ 5
https://code.sololearn.com/ciK6t1NcM2tR/?ref=app
+ 4
Mine here. A bit long and complicated but all that because of better output look.
https://code.sololearn.com/cPb82Zv2wmrY/?ref=app
+ 4
#You didn't stated in your challenge that we can't use inbuilt method. So, this is also one of the solution of your challenge.
#Ruby
require 'prime'; puts Prime.take(gets.to_i)
+ 2
Wait