Cognizant Interview Question

Write prime number program in Java