NUMBER SIGN CHECK

************************************************************************ 

W.A.P TO CHECK NUMBER IS POSITIVE, NEGATIVE OR ZERO

************************************************************************  

JAVA Program







   



  
Online compiler

Output:


************************************************************************ 

C Program



Online Compiler 

 

************************************************************************ 

C++ Program

Online Compiler

************************************************************************ 

C# Program


 
 
Output:

************************************************************************ 

PHP Program


Online Compiler

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>

Online Compiler

************************************************************************ 

PYTHON Program

 

Online Compiler: 

************************************************************************  















Comments

Popular posts from this blog

PALINDROME NUMBER

CONVERT CARTESIAN COORDINATES TO POLAR COORDINATE

FIBONACCI SERIES