-
What is the output of this program?
#include <iostream>
#include <complex>
using namespace std;
int main()
{
complex<double> Comp_double(4, 6);
complex<int> Comp_int(7, 8);
Comp_double *= 2;
Comp_double = Comp_int;
cout << Comp_double;
return 0;
}
-
- (7,8)
- (4,6)
- (8,7)
- (6,4)
- None of these
Correct Option: A
We are just copying the value of Comp_int into Comp_double, So it’s printing as (7,8).