Not able to understand the bool function

My doubt is, why are we using prime[i]*prime[i]<= No in the isPrime function?

@prerna_gupta31
This is being done because all the number which are less than prime*prime will already been have classified by the prime numbers as prime or not prime. We thus impose the condition prime[i]*prime[i]. when prime[i]*prime[i] turns out to be greater than n, this means that all the numbers <= n have already been classified as prime numbers. Thus we break the loop at the stage to reduce time complexity.

If my answer is able to answer your query, please mark the doubt as resolved.
If you face any query, please feel free to revert.