[Solved] How can I find the prime numbers between 1 to the given number, only by using the loop(ie. without any short cuts) in “Ruby”? [duplicate]
This does feel a lot like a school project/task rather than anything meaningful. There are libraries built into Ruby that you can use for high performance Prime calculations puts “Enter the maximum number of the range in which to find the prime numbers: ” last = gets.chomp.to_i prime = [2] all_numbers = (2..last).to_a print “We … Read more