AMD interview question

Write a code for: Given an integer, print all prime numbers up to that integer.