Algoworks interview question

Write code to find prime number in java or c