Prime Number Program Source Code
<html>
<head><TITLE></TITLE>
<script language="JavaScript">
var a=prompt("enter a value");
alert(a);
var c=0;
for(var i=2;i<a;i++)
{
if(a%i==0)
{
c=i;
//alert("Now C IS:"+c);
}
}
if(c==0)
{
alert("given no is prime");
}
else
{
alert("given no is not a prime");
}
</script>
</head>
<body></body>
</html>
}
0 comments:
Post a Comment