He is checkin if i is not prime by checking in the range of 0 to root n

Correct me if i am wrong. What is it that he is doing?

hello @JaveedYara

no by iterating from 2 to sqrt n , bhaiya is checking whether n is a prime number or not.

we are using this property ->
if n is prime then it will not be divisble by any number in range [ 2 …sqrt(n) ]