Persistent Systems Interview Question

Write code to print prime numbers upto given number