Barclays Interview Question

Write java code to print prime numbers?