Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

prime number 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; 
}
Source by codejudge.blogspot.com #
 
PREVIOUS NEXT
Tagged: #prime #number
ADD COMMENT
Topic
Name
7+8 =