09 HTML -Applet HTML record

  Create an applet that accepts two numbers and perform all the arithmetic operations on them. 

PROGRAM:-01

Save:-html_applet9.html

<html>
    <head>
        <title>Arithmetic operations</title>
    </head>
    <script type="text/javascript">
        function Addition()
        {
            x=calc.value1.value;
            y=calc.value2.value;
            z=parseInt(x)+parseInt(y);
            alert("The Addition result is "+z);
            calc.value3.value=z;
        }
        function Subtraction()
        {
            x=calc.value1.value;
            y=calc.value2.value;
            z=x-y;
            alert("The subtraction result is "+z);
            calc.value3.value=z;
        }
        function Multiplication()
        {
            x=calc.value1.value;
            y=calc.value2.value;
            z=x*y;
            alert("The Multiplication result is "+z);
            calc.value3.value=z;
        }
        function Division()
        {
            x=calc.value1.value;
            y=calc.value2.value;
            z=x/y;
            alert("The subtraction result is "+z);
            calc.value3.value=z;
        }
    </script>
    <body bgcolor="goldenrod">
        <form name="calc">
            <h1>Arithmetic Operations</h1>
            Enter first Number &nbsp&nbsp&nbsp&nbsp : <input type="number" id="value1"> </br>
            Enter Second Number : <input type="number" id="value2"> </br>
            <input type="button" Value="Addition" onClick=Addition()> </br>
            <input type="button" Value="Subtraction" onClick=Subtraction()></br>
            <input type="button" Value="Multiplication" onClick=Multiplication()></br>
            <input type="button" Value="Division" onClick=Division()></br><br>
            Result of the Arithmetic operation is : <output type="number" id="value3"> </output>
        </form>
    </body>
</html>

output:-01


 

output:-02


 

output:-03


 

output:-04


 

output:-05


 

output:-06


 

output:-07


 

output:-08        


 

 

 

Comments

Popular posts from this blog

digital marketing ppt-u1

SOFTWARE

cn lab

Computer Operations and Performing - D L Unit-1-1

DS-Record-mca-04) write a program for evaluating a given postfix expression using stack.

Unit 2: Foundations of Ownership, Security Related Concepts in Blockchain

Unit-1 Foundations of Software Systems and Blockchain

Access the Internet to Browse Infromation & E-Mail Operation- D L Unit-2-1

DBMS Degree Lab Records

6)what are the various service of internet and protocols ICT-unit-1