(813 Views)

Below is a simple Calculator program written in C++ which performs operations like Addition, Subtraction, Multiplication, Division and Swapping.

- The first value as an operator should be a char type and one of (+, -, *, /, s) characters which has the following meanings:
- '+' for addition (num1 + num2)
- '-' for subtraction (num1 - num2)
- '*' for multiplication (num1 * num2)
- '/' for division (num1 / num2)
- 's' for swap

- Program receives another two operands (Num1, Num2) which can be a float or an integer
- The program calculates the appropriate result as per the operation specified and prints the relevant results with related message on console
- Swap operator just exchanges the content of two variables

2 UpvotesUpvote |
0 DownvotesDownvote |

- How to count the number of digits of any number using C++ [126 Views]
- How to Install VirtualBox Guest Additions on Debian 9 Virtual Machine (VM) [559 Views]
- Algorithm and Flowchart for Matrix addition [5970 Views]
- Best Book for Advanced PHP User [1325 Views]
- Check if A Number is a Composite number or Not in C++ [465 Views]

- Algorithm to find whether number is Armstrong Number or Not [37730 Views]
- How To Win Ludo King Game Every Time [37716 Views]
- Knuth-Morris-Pratt (KMP) Substring Search Algorithm with Java Example [27012 Views]
- Jio Phone hang on LOGO problem Solution - Hard Reset Jio Phone [26558 Views]
- FlowChart and Algorithm to find Whether a Number is Even or Odd [19156 Views]