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 c1(4.0,3.0);
7.
cout
Options:
A .  c1: (4,3)(7.65844,6.40819)
B .  c1: (4,3)(7,6)
C .  both a & b
D .  None of the mentioned
Answer: Option A

We are adding the two complex numbers and printing the result.
Output:
$ g++ comp3.cpp
$ a.out
c1: (4,3)(7.65844,6.40819)



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers