Write a program in JavaScript to calculate the area of circle through user define function?



<html>
<head>
<title>Area of Circle</title>
<script language="Javascript">
pie=3.14;
function area(r)
{
ar=pie*r*r;
alert("Area of circle = "+ar);
}
</script>
</head>
<body>
<h2>Click on the button to calculate Area</h2>
<input type="button" value="area" OnClick="area(5)">
<hr>
</body>
</html>

Comments

Popular posts from this blog

Write a program to add two number using inline function in C++?

Traversing of elements program with algorithm and Flowchart