Skip to content

About

A simple C++ calculator that performs basic arithmetic operations using functions, switch statements, and user input.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🧮 Calculator Project (C++)

A simple calculator built in C++ that performs basic arithmetic operations using functions.

Features

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • Division by zero validation
  • Menu-driven interface
  • Uses functions for each operation

Concepts Practiced

  • Functions
  • Function Prototypes
  • Return Values
  • Switch Statements
  • Conditional Statements
  • User Input and Output

Example

1. Addition
2. Subtraction
3. Multiplication
4. Division

Choose an operation: 1

Enter first number: 10
Enter second number: 5

Result: 15

How to Run

Compile:

g++ main.cpp -o calculator

Run:

./calculator

What I Learned

  • How to create and use functions
  • How to return values from functions
  • How to organize code into smaller reusable components
  • How to use switch statements for menu-based programs

Author

Faisal Althaqeb

About

A simple C++ calculator that performs basic arithmetic operations using functions, switch statements, and user input.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages