## Assignment 5

### The exercise

Define a structure for storing complex variables. It should consist of two floating point (float or double) fields standing for the real and imaginary parts of a complex number. Define another structure to represent complex numbers in polar coordinates. Unless otherwise stated, a complex variable henceforth means one in its coordinate (real,imaginary) representation.

Write the following functions on complex variables:

• A function for printing complex numbers in a neat format.
• A function that converts a complex number from coordinate to polar representation.
• A function that converts a complex number from polar to coordinate representation.
• A function that adds two complex numbers.
• A function that subtracts a complex number from another.
• A function that multiplies two complex numbers.
• A function that squares a complex numbers.
• A function that divides a complex number by another.
• A function that computes a square root of a complex number. (This is where polar coordinates may be helpful.)

Read three complex numbers a, b and c from the user. Use the above functions to compute and print the two roots of the polynomial

```ax2+bx+c.
```
You may use the Bhaskaracharya formula
```[-b ± V(b2-4ac)]/(2a)
```
to compute square roots.

### Sample output

```Enter a (coefficient of x²) : 1 0
Enter b (coefficient of x)  : -2 0
Enter c (constant term)     : 1 0
The input polynomial is :
(1.000000+i0.000000)x² + (-2.000000+i0.000000)x + (1.000000+i0.000000)
The two roots of this polynomial are :
1.000000+i0.000000 and 1.000000+i0.000000.

Enter a (coefficient of x²) : 1 0
Enter b (coefficient of x)  : 2 0
Enter c (constant term)     : -3 0
The input polynomial is :
(1.000000+i0.000000)x² + (2.000000+i0.000000)x + (-3.000000+i0.000000)
The two roots of this polynomial are :
1.000000+i0.000000 and -3.000000+i0.000000.

Enter a (coefficient of x²) : 2.1 -3.2
Enter b (coefficient of x)  : -4.3 5.4
Enter c (constant term)     : 6.5 -7.6
The input polynomial is :
(2.100000-i3.200000)x² + (-4.300000+i5.400000)x + (6.500000-i7.600000)
The two roots of this polynomial are :
0.830050+i1.423087 and 0.965854-i1.257900.
```

### Test input

Show the output of your program on the following inputs:
abc
1i1
-1-78
-1-77
-i-7i8i
-5+12i00
10-5+12i
16+4i5+12i
0-7i8
-1.2345+1.2345i-2.3456-2.3456i3.4567-3.4567i
-12345+23456i-23456-34567i34567-45678i