Home » C++ Programming » Numbers » Question
  1. What is the output of this program?
    #include <iostream>
    #include <complex>
    using namespace std;
    int main()
    {
    complex<double> CompNum1(2.0, 4.0);
    complex<float> CompNum2(polar(3.0, 0.25));
    cout << (CompNum1 += sqrt(CompNum1)) << endl;
    return 0;
    }
    1. (3.79891,5.11179)
    2. (5.11179,3.79891)
    3. 5.11179
    4. 3.79891
    5. None of these
Correct Option: A

In this program, we are adding both complex number and finding the square root of it.



Your comments will be displayed only after manual approval.