Prev Demo
JavaScript
>
Natural Lgorithm
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to return arccosine value</p> <input type="button" onclick="myFunction()" value="Click"> <p id="myId"></p> <script> function myFunction() { var a = Math.acos(0.3); var b = Math.acos(-0.3); var c = Math.acos(-1.3); var d = Math.acos(1.3); var r = "The arccosine value of 0.3 is :" + a +"<br>" + "The arccosine value of -0.3 is :" + b + "<br>" + "The arccosine value of -1.3 is :" + c + "<br>" +"The arccosine value of 0.3 is :" + d; document.getElementById("myId").innerHTML = r; } </script> <p><strong>Note:</strong>If the input value of arccosine method is not in range between -1 to 1, the output shows NaN.</p> </body> </html>
Note: We DO NOT save your trial code in our database.
Output