Deepak and primes

Can anyone please suggest me anything in deepak and primes question?
here is my code https://ide.codingblocks.com/s/304863