Home Top Ad

Responsive Ads Here

Write a program to Check Number Even or Odd using Javascript

Share:

 <!DOCTYPE html>

<html>

<head>

<title>Even or odd</title>

</head>

<body>

<script type="text/javascript">

var n=prompt("Enter the number even or odd");

n=parseInt(n);

if (isNaN(n))

{

alert("Enter the number");

}

else if(n==0)

{

alert("The number is zero");

}

else if (n%2) 

{

alert("The number is odd");

}

else

{

alert("The number is enen");

}

</script>

</body>

</html>

Post a Comment

No comments

Welcome to saveracom.blogspot.com

Data Science using Spreadsheet Software Assignment 3

Printing Workbooks select the cells you want to print and then set that area as the print area   Steps to set a print area: Select the cells...