Skip to content

Calculator in C that stores an expression from the command-line in an abstract syntax tree before solving it recursively.

Notifications You must be signed in to change notification settings

kdonthi/Command-line-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

Command-line Calculator

This is a commandline calculator that takes in an expression, stores the numbers/operators in an abstract syntax tree, and returns the result.

This can account for parentheses, modulus, adddition, subtraction, modulus, division (negative and positive numbers). This cannot yet take care of decimals, however.

To compile the program, do gcc evalexpr.c and use ./a.out "EXPRESSION" to see the answer.

E.g. ./a.out "3 + 5" or ./a.out "(3 * 5) + 6".

About

Calculator in C that stores an expression from the command-line in an abstract syntax tree before solving it recursively.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages