An integer is a whole number that can be positive, negative, or zero. In other words, integers are the set of numbers {..., -3, -2, -1, 0, 1, 2, 3, ...}.
Integers can be added, subtracted, multiplied, and divided just like other numbers. The rules for operations with integers are:
Addition: When adding two integers with the same sign, add their absolute values and keep the same sign. When adding integers with different signs, subtract the smaller absolute value from the larger absolute value and use the sign of the integer with the larger absolute value.
Subtraction:Subtraction of integers can be thought of as adding the opposite. That is, a - b is the same as a + (-b).
Multiplication: The product of two integers with the same sign is positive, while the product of two integers with different signs is negative.
Division:Division of integers follows similar rules to multiplication, where the quotient is positive if the two integers have the same sign, and negative if they have different signs.
Examples
Here are some examples of operations with integers:
Adding two positive integers: 3 + 5 = 8
Subtracting a negative integer from a positive integer: 7 - (-4) = 7 + 4 = 11
Multiplying a positive and a negative integer: 6 * (-2) = -12
Dividing a negative integer by a positive integer: (-10) / 2 = -5