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

- Pseudocode and Algorithm to find Largest of 2 numbers [370 Views]
- How to Debug Code in Unity3D [357 Views]
- How To Reset Autoincrement value of Column in MySQL [808 Views]
- Algorithm and Flowchart for Implementing a Stack using Linked List [282 Views]
- Mumbai University Computer Engineering Machine Learning (ML) Semester 8 Important Notes Download [1860 Views]

- Knuth-Morris-Pratt (KMP) Substring Search Algorithm with Java Example [10127 Views]
- Algorithm to find whether number is Armstrong Number or Not [9475 Views]
- How To Win Ludo King Game Every Time [9415 Views]
- error: Multiple commands produce error in Xcode 10 [5659 Views]
- FlowChart and Algorithm to find Whether a Number is Even or Odd [5123 Views]