The C # programming language is very similar to other programming languages, and arithmetic and arithmetic expressions are the same.
1.
+ plus
-Minus
* Multiply
/ except
% Redundancy
These basic arithmetic operators can perform arithmetic operations on constants or variables.
In addition, there are self-increment operators and self-subtraction operators.
++
You can think of + + as the function name, followed by a pair of parentheses, this can be achieved self-increment.
+ + in the front, indicating the first self-increment, and then assign value. + + in the back, indicating the first assignment, and then self-increment.
Like what:
int A;
int b;
b=2;
a=++ (b); increment First, then assign value.
A= (b) + +; The value is first assigned and then self-increment.
-- can be used as a function name, followed by a pair of parentheses, which can effectively enhance readability.
-- before, it means to subtract first and then assign a value. -- after , the expression is first assigned and then reduced.
There are also complex arithmetic operators.
+ = For example:a+=3 is equivalent to a=a+3
-= For example:a-=3 is equivalent to a=a-3
*= such as:a*=3 is equivalent to a=a*3
/= such as:a/=3 is equivalent to A=A/3
6. Arithmetic operators and arithmetic expressions for C #