Examveda

What will be the output of the following C++ code?
#include <iostream>
#include <complex>
using namespace std;
int main()
{
    complex<double> c1(4.0, 3.0);
    complex<float> c2(polar(5.0, 0.75));
    cout  << (c1 += sqrt(c1)) << endl;
    return 0;
}

A. (4.0, 3.0)

B. (6.12132, 3.70711)

C. (5.0, 0.75)

D. (5.0, 3.75)

Answer: Option B


Join The Discussion

Related Questions on Classes and Objects in C plus plus