Question
1.
#include
2.
#include
3.
using namespace std;
4.
int main()
5.
{
6.
complex c_double(2, 3);
7.
complex c_int(4, 5);
8.
c_double *= 2;
9.
c_double = c_int;
10.
cout
What is the output of this program?
1.
#include
2.
#include
3.
using namespace std;
4.
int main()
5.
{
6.
complex c_double(2, 3);
7.
complex c_int(4, 5);
8.
c_double *= 2;
9.
c_double = c_int;
10.
cout
Answer: Option B
Was this answer helpful ?
We are just copying the value of c_int into c_double, So it’s printing as (4,5).
Output:
$ g++ comp1.cpp
$ a.out
(4,5)
Was this answer helpful ?
Submit Solution