Prime Number Check What Prime Number? Prime Number is a number that is divisible by only 1 and that number. Suppose 13 is a prime number, because 13 is divisible by 1 (13 % 1 == 0) and 13 is also divisible by 13 (13...

# prime number

## Check Prime Number

Source: function isPrime(num){ var n=Math.sqrt(num); for(i=2;i<=n;i++){ if(num%i==0) return false; } return true; } var number=prompt(“Enter for test”,”0″); if(number!=0 && number!=1){ if(isPrime(number)){ document.write(number+” “+”Is Prime”); }else{ document.write(number+” ” +”Is not prime”); } }else{ document.write(number+” ” +”Is not prime”); } Download Complete Source