Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num_primes = 0
- current_num = 2
- while num_primes < 100
- is_prime = true
- (2..current_num-1).each do |x|
- if current_num % x == 0
- is_prime = false
- break
- end
- end
- if is_prime
- puts current_num
- end
- current_num += 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement