Cognizant Interview Question

prime number code and oops