C/C ++ common operators and operators
Arithmetic Operators
Syntax |
Explanations |
A + B |
Addition (summation) 1 + 1... 2 + 2... 2.5 + 2. 5... and so on |
A-B |
Subtraction (subtraction) 5-2 .. |
A * B |
Multiplication (product) 2*5 |
A/B |
Division (molecular) 10/5 |
A % B |
Modulus (remainder) 9% 2 |
A ++ |
Then, auto-increment first participates in the operation and then auto-Increment |
++ |
Auto-increment first before Calculation |
A -- |
Assign a value first, subtract a for use, and then subtract |
-- |
First subtract and then assign a value, first subtract a and then use. |
A + = B |
It means a = a + B, that is, the result of adding the value of B to a is re-assigned to a, which is a = a + B in short form. |
A-= B |
Abbreviated form of a = a-B |
A * = B |
A = a * B |
A/= B |
Abbreviated form of a = a/B |
A % = B |
Abbreviated form of a = a % B |
Comparison and logical operators
Syntax |
Explanations |
A> B |
More than 5> 3... 100> 50 |
A <B |
Less than 5 <10... 0 <1 |
A> = B |
Greater than or equal |
A <= B |
Less than or equal |
A! = B |
Not equal |
A = B |
Equal |
A & B |
Logical AND (equivalent to AND in other languages) |
A | B |
Logic OR (equivalent to OR in other languages) OR meaning |
! A |
The logic is NOT (equivalent to NOT in other languages ). |