Header file #include<boost/multiprecision/cpp_complex.hpp>
<cpp_complex.hpp> is a header file or a function which is used to work with complex numbers.
The complex number has two parts real and imaginary
The benefits of this function is that it can be used to work with real part and imaginary part simultaneously which makes it more time compitable.
using namespace std;
cout<<"Complex number is "<<s<<endl;
cout<<"Real part is "<<s.real()<<endl;
cout<<"Imaginary is "<<s.imag()<<endl;
cout<<"Square of the number is "<<s*s<<endl;
As mentioned above it can be used to work with real and imaginary part and for working with only real or imaginary part there are two function available in the library