Home » C++ Programming » Numbers » Question
  1. What is the output of this program?
    #include <iostream>
    #include <complex>
    using namespace std;
    int main()
    {
    complex<double> Comp1(3.0, 9.0), Comp2;
    Comp2 = pow(Comp1, 2.0);
    cout << Comp2;
    return 0;
    }
    1. (3.0, 9.0)
    2. (3.0, 2.0)
    3. (9.0, 3.0)
    4. (-72,54)
    5. (-54,72)
Correct Option: D

In this program, we are finding the square of the complex number.



Your comments will be displayed only after manual approval.