Sail E0 Webinar
Question


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
Options:
A .  (2, 3)
B .  (4, 5)
C .  (8, 15)
D .  None of the mentioned
Answer: Option B

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 ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers