(1118 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 |

- Javascript Program to Check whether Number is Prime or Not [1368 Views]
- Algorithm to find whether number is Armstrong Number or Not [23348 Views]
- Debug Javascript code in Android Mobile Browser [2698 Views]
- Prime Number program in Python [926 Views]
- Steps For Installing Git on Ubuntu 18.04 LTS [814 Views]

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