Quantiphi interview question

Coding q : finding a prime no