A fully functional command-line based Arithmetic Calculator built using C programming language.
This project demonstrates structured programming, operator mapping using enum and struct, and clean input validation techniques.
- Basic Operations (+, −, ×, ÷, %)
- Power & Square Root
- Trigonometric Functions (sin, cos, tan)
- Inverse Trigonometric Functions
- Logarithm (base 10)
- Factorial
- Operator Mapping using enum & struct
- Input Validation using fgets & sscanf
- Clean modular function design
- C Programming
- Standard Libraries:
- stdio.h
- stdlib.h
- string.h
- math.h
- ctype.h
- stdbool.h
- Function-based modular programming
- Enum for operation handling
- Struct-based mapping table
- Switch-case execution control
- Error handling & validation
- Loop-driven user interaction
- Compile the program:
Run:gcc calculator.c -o calculator
This project improved my understanding of:
- Clean code structuring
- Mapping logic implementation
- Handling user input safely
- Designing scalable command-line tools
Ashlok Kumar
C Programming Enthusiast