Generates 25 prime numbers from 2 to 97 : Prime Numbers « Number « Ruby






Generates 25 prime numbers from 2 to 97


require 'mathn'

list_primes = Prime.new

puts list_primes.each { |prime| print prime, " "; break unless prime < 90 }

 








Related examples in the same category

1.Prime Numbers
2.Use Prime to generate prime numbers
3.Use each method from Prime class
4.Generating Prime Numbers with succ
5.Pass code block into each