Computer Science, asked by eramkaware786, 1 year ago

to accept two positive or negative numbers and check whether they are equal or not in javascript

Answers

Answered by sc5451832
2

What is JavaScript please tell me

Answered by Anonymous
5

Program to accept two positive or negative numbers and check whether they are equal or not.

function compare()

{ var x, y;  

x = Number(document.getElementById("first").value);  

y = Number(document.getElementById("second").value);  

if ( x == y)

{ document.write("True"); }  

else  

{ document.write("False"); }

}  

</script>  

</head>  

<body>  

Enter the First number : <input id="first">  

Enter the Second number: <input id="second">  

</body>  

</html>

Similar questions