The numbers I will be using to demonstrate all the operators besides incrementing and decrementing are 11 and 5. For the increment examples, I will be using the number 7 for starting the increment operators and 10 for starting the decrement operators.
Addition: 11 + 5 = 16The addition operator adds two variables together. Because of this, my variables of 11 and 5 add together to be 16.
The subtraction operator takes away the amount of the second variable from the first variable. Because of this, the solution for my subtraction equation is 6 because 5 is taken away from 11.
The multiplication operator takes one variable and multiplies it by the value of another variable. Because of this, the solution for my multiplication problem is 55 because 11 was multiplied by 5.
The division operator takes the value of the first variable and divides it by the value of the second variable. Because of this, the answer to my division problem is 2.2 because the number 5 can go into 11 2.2 times.
The modulus operator is similar to the division operator, but it shows what would be leftover from division, also known as a remainder. Because of this, my solution from using the modulus operator is 1 because 5 can go into 11 twice, and then 1 would be leftover as the remainder.
What pre-increment does is increment the variable by one, and then the new number is returned to the same variable. Because of this, when I pre-incremented my number variable of $num3 (7), it changed the value of the variable to 8 and it stayed the same when I used the variable afterwards.
What post-increment does is return the original value of the variable, and then when the variable is used again, it's incremented by one. Because of this, when I first echoed my variable number ($num3), it was then same as it had been before (8). But, when I used the variable a second time, that's when it was incremented from 8 to 9.
What pre-decrement does is it decreases the value of the variable by one, and then the new number is returned to the same variable. Because of this, when I pre-decremented my number variable of $num4 (10), it changed the value of the variable to 9, and it stayed the same when I used the variable again.
What post-decrement does is return the original value of the variable, and then when the variable is used again, the value of the variable is decreased by 1. Because of this, when I post-decremeneted my number variable $num4 (9), it still showed the value of 9. But, when I used the variable again, it value of the variable was decreased by 1 to become the new value of 8.