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.
complex c2(polar(5.0, 0.75));
8.
cout
Options:
A .  (4.0, 3.0)
B .  (6.12132, 3.70711)
C .  (5.0, 0.75)
D .  None of the mentioned
Answer: Option B

In this program, we are adding both complex number and finding the square root of it.
Output:
$ g++ comp4.cpp
$ a.out
(6.12132,3.70711)



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers