
1)print the positive equivalent of the number 2) check if the no is integer or not 3) find the square root of the number 4) find the cube of the number

<html>
<script>
function check(){
var n=document.getElementById("num").value;
if(!isNaN(n)){
alert("Entered value is integer!");
}
else{
alert("Entered value is not an integer!");
}
var num=parseInt(n);
alert("Square root of a number: "+Math.sqrt(num));
var cube=num*num*num;
alert("Cube of a number: "+cube);
}
</script>
Enter Number<input type="text" id="num"><input type="button" value="Check" onclick="check();">
</html>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.