Infosys Interview Question

Code to check for a prime number