Mathmatical Symbols in C
C is able to perform basic mathematical operations on variables and values using the following symbols:
Assignment Operations in C
C can assign values to variables and perform basic mathematical operations using shorthand operators:
- Addition then assignment:
- Subtraction then assignment:
- Multiplication then assignment:
- Division then assignment:
- Modulo then assignment:
Comparing values in C
C can compare two values and/or variables against each other to return true or false. The operators are as follows:
- Do both sides have the same value?
- Do the two sides have different values?
- Is the left side a lower value than the right side?
- Is the left side a lower or equal value to the right side?
- Is the left side a greater value than the right side?
- Is the left side a greater or equal value to the right side?
Logical Operators in C
C can perform logical operations using the following operators:
&&(Are both sides true?)
||(Is at least one side true?)
!(True becomes false and false becomes true.)