Answers for "prime template c++"

C++
0

prime template c++

template<class T> bool isPrime(T n) 
{
	T i;
	if(i < 2) return false;
	for(i = 2; i * i <= n; i++) {
    	if(n % i == 0) return false;
    return true;
}
Posted by: Guest on May-05-2021

Browse Popular Code Answers by Language