================================================================================
  Question 17: Complex Number Operator Overloading
================================================================================

FULL QUESTION:
Create a class ComplexNumber with attributes:
- real
- imag

Requirements:
1. Overload the + operator (__add__) to add two complex numbers:
   (a + bi) + (c + di) = (a + c) + (b + d)i
2. Overload the == operator (__eq__) to check if two complex numbers are equal.
3. Overload __str__ to display complex numbers in standard format (a + bi or a - bi).

SHORT QUESTION:
Complex number class demonstrating operator overloading for addition (+) and equality (==).

================================================================================
README & SETUP INSTRUCTIONS:
================================================================================
# Question 17: Complex Number Operator Overloading

- Prerequisites: Python 3.x (Standard library only).
- Setup: None.
- How to Run: python question_17.py
- Expected Behavior: Performs complex number addition and equality checks using overloaded Python operators (+ and ==).

================================================================================
SOURCE CODE FILES:
================================================================================

1. question_17.py
--------------------------------------------------------------------------------
class ComplexNumber:
    def __init__(self, real, imag):
        self.real = real
        self.imag = imag

    def __add__(self, other):
        new_real = self.real + other.real
        new_imag = self.imag + other.imag
        return ComplexNumber(new_real, new_imag)

    def __eq__(self, other):
        return self.real == other.real and self.imag == other.imag

    def display(self):
        print(f"{self.real} + {self.imag}i")

c1 = ComplexNumber(3, 4)
c2 = ComplexNumber(2, 5)
c3 = ComplexNumber(3, 4)

result_sum = c1 + c2
print("Sum of c1 and c2: ", end="")
result_sum.display()

print("Is c1 equal to c2?:", c1 == c2)
print("Is c1 equal to c3?:", c1 == c3)
--------------------------------------------------------------------------------
