Loading
View RSS Feed

lexis

How to find the Odd Even number using Javascript?

Rating: 7 votes, 4.86 average.
Code:
html>
<head>
<script type="text/javascript">
var n = prompt("Enter a number to find odd or even", "Type your number here");
n = parseInt(n);
if (isNaN(n))
{
alert("Please Enter a Number");
}
else if (n == 0)
{
alert("The number is zero");
}
else if (n%2)
{
alert("The number is odd");
}
else
{
alert("The number is even");
}
</script>
</head>
<body>
</body>
</html>

Submit "How to find the Odd Even number using Javascript?" to Digg Submit "How to find the Odd Even number using Javascript?" to del.icio.us Submit "How to find the Odd Even number using Javascript?" to StumbleUpon Submit "How to find the Odd Even number using Javascript?" to Google

Categories
Java

Comments




Disclaimer: Users of techforum4u.com are responsible for ensuring that any material they post (article, blog posts, images or other mulitimedia content) does not violate or infringe upon the copyright, patent, trademark, or any personal or proprietary rights of any third party, and is posted with the permission of the owner of such rights.Anyone who violates these rules may have their access privileges removed without warning.