SOP1 : Create JavaScript program for the following using appropriate variables, JavaScript inbuilt function and control structures.
To check whether, user entered number is positive or negative
HTML CODE
<html>
<head>
<title>javascript program</title>
</head>
<body bgcolor="pink" text="blue">
<script type="text/javascript">
var a=prompt("enter no");
if(a>0)
document.write("number is positive");
else
if(a<0)
document.write("number is negative");
else
document.write("number is zero");
</script>
</body>
</html>
0 Comments