JavaScript :- Negative & Positive (if...else if)
This is JavaScript Practical :- Negative & Positive (if...else if).
Script written in small letter because JavaScript Case Sensitive.
Script:-
<html>
<head>
<title>NEGETIVE POSITIVE</title>
</head>
<body>
<script type="text/javascript">
var n,a=0;
n=parseInt(prompt("Enter number"));
if (n < a)
{
document.write("THIS IS A NEGETIVE.");
}
else if (n > a)
{
document.write("THIS IS A POSITIVE.");
}
else
{
document.write("0");
}
</script>
</body>
</html>
Save the File .html
Output:-
If you have any doubts mention on the Comment Box.
Please follow the my Blog, Share and Comment.
Comments
Post a Comment