NTT DATA interview question

Wrote a code on prime numbers