Capgemini Interview Question

To check the numbers are prime or not in any language c,cpp,python,java any..