Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
}
 
PREVIOUS NEXT
Tagged: #prime #template
ADD COMMENT
Topic
Name
8+2 =