Use the Sieve of Eratosthenes.
1. List all the numbers from 2 to the number in question.
2. Start with 2. Cross out all multiples of 2.
3. Go to the next number not crossed out. It will be a prime. Cross out all its multiples.
4. Repeat until there is no next uncrossed number.
Hope the solution helped. Sometimes you need more than a solution. Contact fcabanski@hotmail.com for online, private tutoring, or personalized problem solving (quick for groups of problems.)