Skip to content

umahichristopher/Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Calculator

This is a simple calculator built using HTML, CSS, and JavaScript. It allows you to perform basic arithmetic operations such as addition, subtraction, multiplication, and division.

Calculator Preview

Usage

To use the calculator, simply open the index.html file in your web browser. You can click the buttons to input numbers and perform operations. The result will be displayed in the calculator's display area.

Features

  • Addition (+)
  • Subtraction (-)
  • Multiplication (x)
  • Division (÷)
  • Percentage (%)
  • Clear (C)
  • Backspace (⬅️)
  • Equals (=)

How It Works

The calculator uses JavaScript to handle button clicks and perform calculations. It keeps track of the first value, second value, selected operation, and result. When you click an operation button, it stores the first value and the operation. When you click a number button, it appends that number to either the first or second value, depending on whether an operation has been selected. When you click the equals button, it calculates the result based on the stored values and operation.

Contributing

If you'd like to contribute to the development of this calculator, feel free to fork the repository and submit a pull request with your changes.