To understand it better, you should first be familiar with everyday C++ Math Functions. In the following tutorial, look over the following 5 examples and look at how the code changes. We’ll look at Addition, Subtraction, Multiplication, and Division.
ADDITION
*The Math is bolded while the rest is in regular font

Pretty easy, huh? All you really need to know is how to place a variable within the quotations. But that isn’t too hard is it?
SUBTRACTION
Our next function is subtraction and it is not any more difficult. If you must see what the code looks like, look below. Notice that you show the variables the same way you do with addition but you take out the addition sign and place a subtraction sign.
#include <iostream>using namespace std;
int main() { int x; int y; cout<<“Have You Ever Wanted to subtract 2 Numbers? Of course! You can do that right here! Enter your first number!”; cin>> x; cout<<“Enter your second number!”; cin>> y; cout<<“The difference of the two numbers is ” << xy; system(“pause”); return 0; } 
Not hard at all. In fact, multiplication and division are practically the EXACT SAME. Just change the sign. Look below for an example of each.
MULTIPLICATION
#include <iostream>using namespace std;
int main() { int x; int y; cout<<“Have You Ever Wanted to Multiply 2 Numbers? Of course! You can do that right here! Enter your first number!”; cin>> x; cout<<“Enter your second number!”; cin>> y; cout<<“The product of the two numbers is ” << x*y; system(“pause”); return 0; } 
DIVISION
#include <iostream>using namespace std;
int main() { int x; int y; cout<<“Have You Ever Wanted to Divide 2 Numbers? Of course! You can do that right here! Enter your dividend number!”; cin>> x; cout<<“Enter your divisor number!”; cin>> y; cout<<“The quotient of the two numbers is ” << x/y; system(“pause”); return 0; } 
THE CALCULATOR
Now I think you’re ready to see what happens when everything is laced together. Our good friend iPodnerd wrote the following program for a class he taught and was gracious enough to let us use the code. Here is the following code for a simple calculator.
#include <iostream>using namespace std;
int main() if(choice == 1) system(“pause”) 
This may have come across as intimidating but it uses simple functions. Look at it carefully and notice the following two points as you scan the code:
 At the beginning of the entire program, everything look standard, right? iPodnerd defined all of the variables and all that happiness. But he used floats instead of integers! What the !@#$ is a float, you ask. Well, a float is another way of looking at integers. If you have trouble understanding floats, refer to this tutorial.
 The rest of the code is just like the addition, subtraction, multiplication, and division segments, but all in one. He reuses the same variable to make the code more concise and easier to follow.
That wasn’t so hard was it? Of course not! Next time, we’ll show you other C++ Math functions. And remember the following:
 Addition uses “+” when adding numbers
 Subtraction uses “” when subtracting numbers
 Multiplication uses “*” when multiplying numbers
 Division uses “/” when dividing numbers
Happy trails!