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 i(2, 3);
7.
i = i * 6 / 3;
8.
cout
Options:
A .  (4, 6)
B .  (2, 3)
C .  (6, 12)
D .  None of the mentioned
Answer: Option A

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



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers