CACI International interview question

Write a program to generate all prime numbers