Complex Number Type

Q.

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

Answer : Option A

Explanation :

We are multiplying the complex number by 2.
Output:
$ g++ comp2.cpp
$ a.out
(4,6)