Skip to content

HashemALSKKkAF/simple-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Advanced Calculator

Overview

This repository contains a simple C++ program that evaluates mathematical expressions using variables and standard operators. It supports basic arithmetic operations, parentheses, and exponentiation.


Features

  • Define variables and use them in expressions.
  • Support for common operators: +, -, *, /, ^.
  • Converts infix expressions to postfix notation for evaluation.

How to Use

  1. Clone the repository:
    git clone https://github.com/your-repo-link.git
    cd your-repo-directory
    
  2. Compile the program:

bash Copy code g++ -o calculator calculator.cpp -std=c++11

  1. Run the program:

bash Copy code ./calculator

  1. Example Input: Variables:

var1 = 5
var2 = 3 Expression:

var1 + var2 * (2 ^ 3) Output: Postfix Expression: var1 var2 2 3 ^ * +

Result: 29

About

simple calculator in c++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages