Learning coding means GreatToCode Be more than a Coder ! Greattocode , Join GreatToCode Community,1000+ Students Trusted On Us .If You want to learn coding, Then GreatToCode Help You.No matter what It Takes !


CODE YOUR WAY TO A MORE FULFILLING And HIGHER PAYING CAREER IN TECH, START CODING FOR FREE Camp With GreatToCode - Join the Thousands learning to code with GreatToCode
Interactive online coding classes for at-home learning with GreatToCode . Try ₹Free Per Month Coding Classes With The Top Teachers . Python programs to perform addition, subtraction, multiplication, and division of two complex numbers

Python programs to perform addition, subtraction, multiplication, and division of two complex numbers

Become More Then A coder | Learn & Start Coding Now.

Here are Python programs to perform addition, subtraction, multiplication, and division of two complex numbers:


### 1. Addition of Two Complex Numbers:

```python
# Program 1: Addition of two complex numbers
def add_complex(num1, num2):
    return num1 + num2

complex1 = 2 + 3j
complex2 = 4 + 5j
result_addition = add_complex(complex1, complex2)
print("Addition:", result_addition)
```

### 2. Subtraction of Two Complex Numbers:

```python
# Program 2: Subtraction of two complex numbers
def subtract_complex(num1, num2):
    return num1 - num2

complex1 = 2 + 3j
complex2 = 4 + 5j
result_subtraction = subtract_complex(complex1, complex2)
print("Subtraction:", result_subtraction)
```

### 3. Multiplication of Two Complex Numbers:

```python
# Program 3: Multiplication of two complex numbers
def multiply_complex(num1, num2):
    return num1 * num2

complex1 = 2 + 3j
complex2 = 4 + 5j
result_multiplication = multiply_complex(complex1, complex2)
print("Multiplication:", result_multiplication)
```

### 4. Division of Two Complex Numbers:

```python
# Program 4: Division of two complex numbers
def divide_complex(num1, num2):
    return num1 / num2

complex1 = 2 + 3j
complex2 = 4 + 5j
result_division = divide_complex(complex1, complex2)
print("Division:", result_division)
```

These programs demonstrate how to perform addition, subtraction, multiplication, and division of two complex numbers in Python. You can replace the `complex1` and `complex2` variables with any desired complex numbers to perform the respective operations.

Post a Comment

0 Comments

•Give The opportunity to your child with GreatToCode Kid's • Online Coding Classes for Your Kid • Introduce Your kid To the world's of coding
•Fuel You Career with our 100+ Hiring Partners, Advance Your Career in Tech with GreatToCode. •Join The Largest Tech and coding Community and Fast Forward Your career with GreatToCode. •10000+ Learner's+ 90 % placement Guarantee. • Learning Coding is Better with the GreatToCode community .
•Greattocode Kid's •GreatToCode Career •GreatToCode Interview •GreatToCode Professional •GreatToCode for schools •GreatToCode For colleges •GreatToCods For Businesses.
Are you ready to join the millions of people learning to code? GreatToCode Pass is your one-stop-shop to get access to 1000+ courses, top-notch support, and successful job placement. What are you waiting for? Sign up now and get your future in motion with GreatToCode Pass.