Deepak and primes II

two test cases show no output : https://ide.codingblocks.com/#/s/14682
question link :https://hack.codingblocks.com/contests/c/452/760

Heyy ! your code will work only for n<= 10^8 but you should take care of larger n as well . So run a nested for loop of which outer loop goes from 2 to sqrt(b) (because nos from a to b can have prime factors lying in this range only ) and then your second loop will go from a to b and check if i is prime or not if yes then cancel its multiple in the given range (a to b) .
For more clarification you can see this code https://ide.codingblocks.com/#/s/14737