adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <complex>
    using namespace std;
    int main()
    {
       complex<double> c1(4.0,3.0);
       cout << "c1: " << c1;
       complex<float> c2(polar(5.0,0.75));
       cout << c1 + complex<double>(c2.real(),c2.imag());
       return 0;
    }

a.

c1: (4,3)(7.65844,6.40819)

b.

c1: (4,3)(7,6)

c.

both c1: (4,3)(7.65844,6.40819) & c1: (4,3)(7,6)

d.

None of the mentioned

Answer: (a).c1: (4,3)(7.65844,6.40819)

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?