(210 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 check Mobile Number is Valid or not in java [155 Views]
- How to check if an array is empty in JavaScript? [140 Views]
- Java Program to Calculate Area Of Triangle with 3 Sides Given [128 Views]
- Mumbai University Theoretical Computer Science (TCS) Semester 4 Important Notes Download [424 Views]
- Algorithm and Pseudocode for Insertion Sorting [345 Views]

- Knuth-Morris-Pratt (KMP) Substring Search Algorithm with Java Example [6566 Views]
- Pseudocode and Algorithm to find whether number is Armstrong Number or Not [5374 Views]
- How To Win Ludo King Game Every Time [5135 Views]
- error: Multiple commands produce error in Xcode 10 [4104 Views]
- Create Dynamic Pagination using Java Spring Boot, Hibernate and MySQL [3315 Views]