NUMBER SIGN CHECK
************************************************************************
W.A.P TO CHECK NUMBER IS POSITIVE, NEGATIVE OR ZERO
************************************************************************
JAVA Program
Output:
************************************************************************
C Program
Online Compiler
************************************************************************
C++ Program
Online Compiler
************************************************************************
C# Program
************************************************************************
PHP Program
Php is a server side scripting language.
************************************************************************
JAVASCRIPT Program
<!DOCTYPE html>
<html><head><meta charset="utf-8"><title></title>
<script type="text/javascript">
function check() {
var value=document.getElementById('data').value;
// var res = Math.sign(value);
// user define fun
if (value>0){
res = `${value} is Positive Number`;
}
else if(value <0){
res = `${value} is Negative Number`;
}
else if(value == 0){
res = `${value} is Zero`;
}
else{
res = `${value} is Not a Number`;
}
document.getElementById('res').innerText= res;
}
</script>
</head><body>
<!-- Math.sign() -->
<input type="number" name="" id="data" step="any"/> Number
<button onclick="check()">Check</button>
<h1 id="res"></h1>
</body></html>
************************************************************************
PYTHON Program
************************************************************************
Comments
Post a Comment