Print prime numbers from 1 to n

how to make this can anyone help