Tech Mahindra interview question

write find Prime numbers logic?