code
<html> <head> <script type="text/javascript"> function solve(){ document.asim.num.value=eval(document.asim.num.value); } function sin(){ document.asim.num.value=Math.sin(document.asim.num.value); } function cos(){ document.asim.num.value=Math.cos(document.asim.num.value); } function tan(){ document.asim.num.value=Math.tan(document.asim.num.value); } function sini(){ document.asim.num.value=Math.asin(document.asim.num.value); } function cosi(){ document.asim.num.value=Math.acos(document.asim.num.value); } function tani(){ document.asim.num.value=Math.atan(document.asim.num.value); } function sq(){ document.asim.num.value=eval(document.asim.num.value)*eval(document.asim.num.value); } function cub(){ document.asim.num.value=eval(document.asim.num.value)*eval(document.asim.num.value)*eval(document.asim.num.value); } function exp(){ document.asim.num.value=Math.exp(document.asim.num.value); } function log(){ document.asim.num.value=Math.log(document.asim.num.value); } function inv(){ document.asim.num.value=1/(document.asim.num.value); } function pi(){ document.asim.num.value=22/7; } function sqrt(){ document.asim.num.value=Math.sqrt(document.asim.num.value); } </script> </head> <body> <form name="asim"><center> <table border="2"> <tr><td colspan="4"><input type="text" name="num" size="45"><br></td></tr> <tr> <td><input type="button" value="1" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='1'"/></td> <td><input type="button" value="2" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='2'"/></td> <td><input type="button" value="3" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='3'"/></td> <td><input type="button" value="4" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='4'"/></td></tr> <tr><td><input type="button" value="5" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='5'"/></td> <td><input type="button" value="6" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='6'"/></td> <td><input type="button" value="7" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='7'"/></td> <td><input type="button" value="8" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='8'"/></td></tr> <tr><td><input type="button" value="9" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='9'"/></td> <td><input type="button" value="0" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='0'"/></td> <td><input type="button" value="." style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='.'"/></td> <td><input type="button" value="+" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='+'"/></td></tr> <tr><td><input type="button" value="-" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='-'"/></td> <td><input type="button" value="*" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='*'"/></td> <td><input type="button" value="/" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='/'"/></td> <td><input type="button" value="Mod" style="height: 25px; width: 70px" onclick="(document.asim.num.value) +='%'"/></td></tr> <tr><td><input type="button" value="sqre" style="height: 25px; width: 70px" onclick="sq()"/></td> <td><input type="button" value="cube" style="height: 25px; width: 70px" onclick="cub()"/></td> <td><input type="button" value="sqrt" style="height: 25px; width: 70px" onclick="sqrt()"/></td> <td><input type="button" value="pi" style="height: 25px; width: 70px" onclick="pi()"/></td></tr> <tr><td><input type="button" value="log" style="height: 25px; width: 70px" onclick="log()"/></td> <td><input type="button" value="sin" style="height: 25px; width: 70px" onclick="sin()"/></td> <td><input type="button" value="cos" style="height: 25px; width: 70px" onclick="cos()"/></td> <td><input type="button" value="tan" style="height: 25px; width: 70px" onclick="tan()"/></td></tr> <tr><td><input type="button" value="exp" style="height: 25px; width: 70px" onclick="exp()"/></td> <td><input type="button" value="asin" style="height: 25px; width: 70px" onclick="sini()"/></td> <td><input type="button" value="acos" style="height: 25px; width: 70px" onclick="cosi()"/></td> <td><input type="button" value="atan" style="height: 25px; width: 70px" onclick="tani()"/></td></tr> <tr><td><input type="button" value="1/x" style="height: 25px; width: 70px" onclick="inv()"/></td> <td><input type="button" value="C" style="height: 25px; width: 70px" onclick="(document.asim.num.value)=0"/></td> <td colspan="2"><input type="button" value="=" style="height: 25px; width: 145px" onclick="solve()"/></td><tr> </table> </center> </form> </body> </html>
nice job.............
ReplyDelete