What is the code for a calculator

<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Calculator Made by Sanjith </title>
<link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet">
<style>
    * {
        font-family: 'Inconsolata', monospace;
        color: rgb(0, 0, 0);
    }
    body {
        background: linear-gradient(to right, rgb(24, 184, 168), rgb(118, 190, 50));;
    }
    .container {
        width: 320px;
        background: linear-gradient(to right, rgb(173, 58, 173), rgb(184, 63, 26));;
        margin: 120px auto;
    }
    table {
        width: 100%;
        border-color: #09646407;
        background: linear-gradient(to right, rgb(184, 24, 37), rgb(78, 13, 230));;
    }
    td {
        width: 25%;
        border-color: rgba(0, 0, 0, 0.363);
    }
    button {
        width: 100%;
        height: 70px;
        font-size: 24px;
        background: linear-gradient(to right, rgb(151, 11, 151), rgb(190, 94, 50));;      
        border: none;
    }
    #inputLabel {
        height: 120px;
        font-size: 40px;
        vertical-align: bottom;
        text-align: right;
        padding-right: 16px;
        background: linear-gradient(to right, rgb(4, 65, 88), rgb(226, 68, 47));;
    }
</style>
</head>
<body>
<div class="container">
    <table border="1" cellspacing="0">
        <tr>
            <td colspan="4" id="inputLabel">0</td>
        </tr>
        <tr>
            <td colspan="3"><button onclick="pushBtn(this);">AC</button></td>
            <td><button onclick="pushBtn(this);">/</button></td>
        </tr>
        <tr>
            <td><button onclick="pushBtn(this);">7</button></td>
            <td><button onclick="pushBtn(this);">8</button></td>
            <td><button onclick="pushBtn(this);">9</button></td>
            <td><button onclick="pushBtn(this);">*</button></td>
        </tr>
        <tr>
            <td><button onclick="pushBtn(this);">4</button></td>
            <td><button onclick="pushBtn(this);">5</button></td>
            <td><button onclick="pushBtn(this);">6</button></td>
            <td><button onclick="pushBtn(this);">-</button></td>
        </tr>
        <tr>
            <td><button onclick="pushBtn(this);">1</button></td>
            <td><button onclick="pushBtn(this);">2</button></td>
            <td><button onclick="pushBtn(this);">3</button></td>
            <td><button onclick="pushBtn(this);">+</button></td>
        </tr>
        <tr>
            <td colspan="2"><button onclick="pushBtn(this);">0</button></td>
            <td><button onclick="pushBtn(this);">.</button></td>
            <td><button onclick="pushBtn(this);">=</button></td>
        </tr>
    </table>
</div>
 
<script>
    var inputLabel = document.getElementById('inputLabel');
     
    function pushBtn(obj) {
         
        var pushed = obj.innerHTML;
         
        if (pushed == '=') {
            // Calculate
            inputLabel.innerHTML = eval(inputLabel.innerHTML);
             
        } else if (pushed == 'AC') {
            // All Clear
            inputLabel.innerHTML = '0';
             
        } else {
            if (inputLabel.innerHTML == '0') {
                inputLabel.innerHTML = pushed;
                 
            } else {
                inputLabel.innerHTML += pushed;   
            }
        }
    }
</script>
</body>
</html>

4
3
Sewo 95 points

                                    x = input(&quot;first number&quot;)
y = input(&quot;second number&quot;)
z = input(&quot;do you want to multiply, minus, divide or add? (x,-,/,+)&quot;)

y = int(y)
x = int(x)

if z == &quot;+&quot;:
    print (x + y)

if z == &quot;/&quot;:
    print (x / y)

if z == &quot;x&quot;:
    print (x * y)

if z == &quot;-&quot;:
    print (x - y)

else:
    print(&quot;use x,-,/ or + next time!&quot;)

4 (3 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
calculator' calculator % code caculator % calculator cal calculator = calculator calculatorl a code of calculator calculatore code code on calculator how to see the code for an online calculator calculator ] how to code for a calculator calculator online calculator. code calculator can you code on a calculator calculator online calculator what code do calculators use online calculator code code for calculator calcuator code how to code calculator calculator js code how to create calcultor in python calculator in html how to create a webpage where users can do basic calculations in javascript calc calculator calculator html and javascript when was calculator invented can u use a calculator on the UKMT calutator html calculator coding how to make online calculator in html calculator using javascript code simple operating calculator source code in website vat calculator expand the function calculator kundi calculator how to make calculator in javascript rpn calculator written in standard form calculator manning's formula calculator orthocenter calculator with steps beroas calculator create calculator in html caculator html design how to make a calculator in js calculator code in html python create module calculator how to create function a calculator javascript javascript calculator with buttons simple calculator using javascript and html calculator on python how to program a calculator in javascript simple calculator html code javascript calculator code is calculate a function in python make calculator javascript simple calculator html calculator in javascript html simple calculator in html code an interactive calculator online with html how to code a calculator javascript calculator interactive calculator using js making calculator in javascript calculator logic in javascript code for making calculator in html getting calculator display to work in javacsript calculator javascript code html calculator code html calculator example how to make a calculator javascript making a calculator in javascript how to build a calculator how to build a calculator with javascript JS CALCULATOR calculator ui html create multiple calculator using javascript javascript calculuator code to make a calculator calculator using javascript how to build an html calculator javascript calculator using table javascript notes to make a calculator calculator script small calculator js algorithm for simple calculator in html and js calculator with js how to make calculator in js source code js calculator code calculator app using javascript data calculator javascript making a calculator using javascript building calculator javascript how to make a calculator with javascript how to make a calculator in html with javascript m,ake a calculator in JS javascript calculator without input field js event calculator calculator in html' html5 make calculator scientific calculator algorithm in javascript special function calculator with steps algorithm in javascript code to create a calculator in html how to build a calculator in js calculator js how to make a calculator js calculate html code html simple calculator making a calculator with javascript html calculator design how to do calculator in js how to build a simple calculator using javascript calculator in html and javascript makeing calculation in html simple calculator in javascript and html basic calculation app in html how to make html button do calculation calculator web app calculator html input api how to make a calculator html javascript calculation page js run a program (like calculator) calculation method python html code for calculator calculator in html js calculator using js and html calculator using javascript and html complete calculator in javascript script for calculator how to make a calcultor web app. html calculator calculator js html how to create a calculator in javascript calculator code html and javascript code for calculator in html html calculator interface a calculator code with python html how to make calculator calculator html js how does calculator work Javascript code write calculater screen how to make a calculator in webbroswer javascript calculator logic calcu;ator in javascript complication pyhton calculator html calculators python calculator code copy and paste displaying what we typed while making calculator in html how to make a calcualtor in html javascript simple calculator calculator in html css and javascript how to code a simple calculator in python how to create a calculator using javascript how to do clulater interactive in javascript calculator using html css and javascript how to create a calculator in html calculator for website code python calaculator calculato in javascript calculator button javascript simple calculator html calculator code for javascript calculator using html csss calulator html css js how to create a calculator html javascrip t calcultor code calculator logic js make a calculator in javascript how to use point in html calculator 2 value calculator html code calculator design html css code how make a calculator in js step by step calculator using python how to make your html calcultor give output how to get a awnser out of your html calculator building a calculator in html create html calculator want to code a calculator with different values calculator using html and js calculator html with text calculator html desing how to make a javascript calculator how to code a calculator in html html calculator code\ calculator html code is there any function to type + only one time in calculator in html how to type into a javascript calculator how to create a calculator in javascipt how to program the enter button in a calculator javascript calculator in javascript how make a calculator javascript step by step simple html calculator calculator program in html and javascript calculator using html and css % calculator for python python ccalculetor basic calculator program in python create a calculator in javascript calculator html css html css calculator build a calculator in code calculator in js and html code for simple calculator in python how to build a calculator using javascript calculator in javascript code calculator app in javascript how to make a calculator in html python simple calculator program calculator code in javascript python simple calculator html calculator javascript html web page calculator html webpage calculator calculating efence using python javascript code for calculator javascript for calculator calculator with html css and javascript simple calculator python website calculator html html and javascript calculator caluclator model in java script simple calculator using javascript code for a calculator What is the code for a calculator calculator module in python develop a menu driven python program to design a simple calculator. for arthematic and relational operator develop a menu driven python program to design a simple calculator. python calcultor make calculator in python python on calculator python program for calculator realtivebearing python calculator python calculator pro how to make a calculator python python print calc calculator in js python calc Create and test an HTML document that has a basic calculator. python calculator code pdf python calculator example python calculator code how to make a calculator in python 8 digits calculator with javascript html script for calculator with html and javascript create calculator using 4 functions examples of calculations in python write menu based program in python to create a four way calculator html calculator make a calculator js build a calculator in python for how to create a calculator in python code to make calculator in python how to code a calculator in Python how to create a calculator with python calculater code code for calculator in python making calculator in python calculator program in python code ofr a calculator make a calculator using javascript python calculator project make a calculator on python vs code python basic calculation between two numbers calculator app in python how to make a calculator with python calculator with python programming a calculator calculator python how to create calculator in python how to make a claculator in python how to make a calculator in python calculator html python calculator simple calculator in python calculator code
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source