I'm pretty new to programming in general and I have a very basic idea of of how everything works. I'm going through practice questions to help improve my programming and I cannot seem to figure out the following, it's got me stumped.

A prime number is any positive integer that is evenly divisible only by itself and
one. The smallest prime number is two. Devise a method to calculate prime
numbers based on divisibility. Write a program that calculates and displays all
the prime numbers up to a maximum number specified by the user. For
example, if the user wished to see all the primes up to 25, the program would
provide the following list: 2, 3, 5, 7, 11, 13, 17, 19 and 23. The program needs
to display the list in an appropriate way.

Could anyone lend a helping hand? Thanks.