Infosys interview question

I was asked to write code for prime number