Publicis Sapient interview question

Core java and print prime number