Regarding Deepak and primes

Please look into this code https://ide.codingblocks.com/s/97979 .It is giving run time error.Why?

You are supposed to use prime seive optimisation in your code. Plz refer to online video lecture given in the course on prime seive optimisation