Search⌘ K
AI Features

Finding Prime Numbers

Explore how to identify prime numbers between 1 and 20 using Ruby by applying ranges and flag variables. Understand the concept of prime numbers and practice writing efficient code to solve this problem. This lesson helps build foundational programming skills through hands-on problem solving.

Problem

Find the prime numbers between 11 and 2020 and store them in an array called array .

Prime numbers (up to 20) are : 2, 3, 5, 7, 11, 13, 17, 19
Find prime numbers

Prime number

A prime number is a number that is bigger than one, and has no divisors other than ...