0% found this document useful (0 votes)
5 views

Arithmetic Operators

Arithmetic operators are symbols used to perform mathematical operations on numbers, including addition, subtraction, multiplication, division, floor division, modulus, and exponentiation. Each operator has a specific function and example demonstrating its use. A summary table provides a quick reference for each operator, its symbol, description, and an example result.

Uploaded by

kalpanapriyam213
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Arithmetic Operators

Arithmetic operators are symbols used to perform mathematical operations on numbers, including addition, subtraction, multiplication, division, floor division, modulus, and exponentiation. Each operator has a specific function and example demonstrating its use. A summary table provides a quick reference for each operator, its symbol, description, and an example result.

Uploaded by

kalpanapriyam213
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

What Are Arithmetic Operators?

Arithmetic operators are used to perform mathematical operations on numbers.

1. Addition (+)

Adds two numbers.


a = 10
b = 5
result = a + b
print("Addition:", result) # Output: 15

2. Subtraction (-)

Subtracts the second number from the first.

a = 10
b = 5
result = a - b
print("Subtraction:", result) # Output: 5

3. Multiplication (*)

Multiplies two numbers.


a = 10
b = 5
result = a * b
print("Multiplication:", result) # Output: 50

4. Division (/)

Divides the first number by the second and returns a float.

a = 10
b = 5
result = a / b
print("Division:", result) # Output: 2.0

Even if both numbers are integers, result is float.

5. Floor Division (//)

Divides and returns the integer part (no decimals).


a = 10
b = 3
result = a // b
print("Floor Division:", result) # Output: 3

6. Modulus (%)

Returns the remainder of division.

a = 10
b = 3
result = a % b
print("Modulus:", result) # Output: 1

7. Exponentiation (**)

Raises the first number to the power of the second.


a = 2
b = 3
result = a ** b # 2 raised to power 3
print("Exponentiation:", result) # Output: 8

Full Example (All Together)

x = 9
y = 4

print("Addition:", x + y) # 13
print("Subtraction:", x - y) # 5
print("Multiplication:", x * y) # 36
print("Division:", x / y) # 2.25
print("Floor Division:", x // y) # 2
print("Modulus:", x % y) # 1
print("Exponent:", x ** y) # 6561

Summary Table

Operator Symbol Description Example Result

Addition + Adds values 3+2 5


Subtract - Subtracts values 3-2 1

Multiply * Multiplies values 3*2 6

Divide / Divides values 3/2 1.5

Floor Div // Integer division 3 // 2 1

Modulus % Remainder of division 3 % 2 1

Exponent ** Power operation 3 ** 2 9

You might also like