Tech Mahindra Interview Question

write find Prime numbers logic?