Applied Materials Interview Question

Output all prime numbers up until input n