- Here we perform division of two complex number.
Example-
first complex is 1+2j
second complex is 2+1j
division of first by second is -1+1j
first complex is 5+2j
second complex is -1+0j
division of first by second is 6+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("Division of first number by second number is ",n1/n2)
Enter first complex number
1+2j
Enter second complex number
2+1j
First complex is (1+2j)
Second complex is (2+1j)
Division of first number by second number is (0.8+0.6j)
Enter first complex number
1+2j
Enter second complex number
0+1j
First complex is (1+2j)
Second complex is 1j
Division of first number by second number is (2-1j)