Complex Number Type

1

What is the output of this program?

1.
    #include 
2.
    #include 
3.
    using namespace std;
4.
    int main ()
5.
    {
6.
        complex mycomplex (20.0, 2.0);
7.
        cout << imag(mycomplex) << endl;
8.
        return 0;
9.
    }
A. 2
B. 20
C. 40
D. None of the mentioned

2

Which of the following is not a function of complex values?

A. real
B. imag
C. norm
D. cartesian

3

What is the output of this program?

1.
    #include 
2.
    #include 
3.
    using namespace std;
4.
    int main()
5.
    {
6.
        complex c1(4.0, 3.0);
7.
        complex c2(polar(5.0, 0.75));
8.
        cout  << (c1 += sqrt(c1)) << endl;
9.
        return 0;
10.
    }
A. (4.0, 3.0)
B. (6.12132, 3.70711)
C. (5.0, 0.75)
D. None of the mentioned

4

What is the output of this program?

1.
    #include 
2.
    #include 
3.
    using namespace std;
4.
    int main()
5.
    {
6.
       complex c1(4.0,3.0);
7.
       cout << "c1: " << c1;
8.
       complex c2(polar(5.0,0.75));
9.
       cout << c1 + complex(c2.real(),c2.imag());
10.
       return 0;
11.
    }
A. c1: (4,3)(7.65844,6.40819)
B. c1: (4,3)(7,6)
C. both a & b
D. None of the mentioned

5

What is the output of this program?

1.
    #include 
2.
    #include 
3.
    using namespace std;
4.
    int main()
5.
    {
6.
        complex i(2, 3);
7.
        i = i * 6 / 3;
8.
        cout << i;
9.
        return 0;
10.
    }
A. (4, 6)
B. (2, 3)
C. (6, 12)
D. None of the mentioned