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, 16.0), c2;
       c2 = pow(c1, 2.0);
       cout << c2;
       return 0;          
    }

a.

(-240, 128)

b.

(240, 128)

c.

(240, 120)

d.

None of the mentioned

Answer: (a).(-240, 128)

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?