Home » C++ Programming » Numbers » Question
  1. What is the output of this program?
    #include <iostream>
    #include <complex>
    using namespace std;
    int main ()
    {
    complex<double> Comp (10.0, 4.0);
    cout << imag(Comp) << endl;
    return 0;
    }
    1. 10.0
    2. 4.0
    3. 4
    4. 10
    5. None of these
Correct Option: C

imag part will return the imaginary part of the complex number.



Your comments will be displayed only after manual approval.