Astound Digital interview question

What is code and logic for prime no.s