This Program Is About How To Find Area Of A Circle, Triangle And Simple Interest Using JavaScript
<html>
<head>
<title></title>
</html>
<body>
<script language="javascript">
var ch;
document.write("1 for area of circle<br>")
document.write("2 for area of triangle<br>")
document.write("3 for area of simple interest<br>")
ch=prompt("Enter choice:",0)
ch=eval(ch)
switch(ch)
{
case 1: r=prompt("Enter radious:",0)
aoc=3.14*(r*r);
document.write("area of circle:"+aoc);
break;
case 2: l=prompt("Enter l:",0)
b=prompt("Enter b:",0)
aot=(l*b)/2;
document.write("area of triangle:"+aot);
break;
case 3: p=prompt("Enter p:",0)
r=prompt("Enter r:",0)
n=prompt("Enter n11:20 AM 7/20/2009:",0)
si=(p*r*n)/100;
document.write("interest is:"+si);
break;
default:
document.write("invalid input:");
}
</script>
</body>
</thml>
No comments:
Post a Comment