Why is it needed to type cast with long long at 4:28?

why is it needed to type cast with long long at 4:28?
why will the no overflow as bhaiya mentioned?

Yes, it is to avoid integer overflow because prime[i]*prime[i] can be greater 10^9, which is greater than the range of int.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.