-here we perform addition of two complex.
- In addition of two complex, real part are add to real and imaginary part is add to imaginary.
Example-
first complex is 1+2j
second complex is 2+1j
addition is 3+3j
first complex is 5+2j
second complex is -1+0j
addition is 4+2j
program-
print("Enter first complex number")
n1=complex(input())
print("Enter second complex number")
n2=complex(input())
print("First complex is ",n1)
print("Second complex is ",n2)
print("Addition of both complex number is ",n1+n2)
Enter first complex number
3+2j
Enter second complex number
1+2j
First complex is (3+2j)
Second complex is (1+2j)
Addition of both complex number is (4+4j)
Enter first complex number
-1-4j
Enter second complex number
0+2j
First complex is (-1-4j)
Second complex is 2j
Addition of both complex number is (-1-2j)