Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/matt-y-ice/stack_calculator


https://github.com/matt-y-ice/stack_calculator

Last synced: 15 days ago
JSON representation

Awesome Lists containing this project

README

        

# Stack Calculator

A simple stack-based calculator implemented in C that converts infix expressions to postfix and evaluates them.

## Features

- Converts infix expressions to postfix notation
- Evaluates postfix expressions
- Handles multi-digit numbers and basic arithmetic operators (+, -, *, /)

## Usage

### Compilation

Compile the program using `gcc`:

```sh
gcc -o stack_calculator stack_calculator.c
```
### Runing the program

To run the program, pass an infix expression as a command-line argument (note: current version does not handle floats as inputs)

```sh
./stack_calculator "3+5*2"
# Output: 13.000000
```