Cognizant interview question

Write a code for the detection of prime numbers?