Skip to content

bhnum/basic-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Calculator

Clone this repository and run make. You will need flex and bison.

Sample output

$ ./calc
a = 400 ^ 2
b = sqrt(a)
b
400.000000
sin(2 * 15)
0.500000
d = c
Variable c was not declared!
Error in calculation
sdf(23/0+d)
Cannot divide by zero!
Variable d was not declared!
Function sdf does not exist!
Error in calculation