Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

html prime number program

<!doctype html>
<html>
<body>
<script>
var num, i, chk=0;
num=19;
for(i=2; i<num; i++)
{
  if(num%2==0)
  {
    chk++;
    break;
  }
}
if(chk==0)
  document.write(num + " is a Prime Number");
else
  document.write(num + " is not a Prime Number");
</script>
</body>
</html>
 
PREVIOUS NEXT
Tagged: #html #prime #number #program
ADD COMMENT
Topic
Name
1+7 =