What will be the output of the following C++ code? [code] #include <iostream> #include <complex> using namespace std; int main() { complex

Hoàng Minh An

New member
What will be the output of the following C++ code?
Code:
#include <iostream>
#include <complex>
using namespace std;
int main()
{
	complex <double> cn(3.0, 5.0);
	cout<<"Complex number is: "<<real(cn)<<" + "<<imag(cn)<<"i"<<endl;
	return 0;
}
A. Complex number is: 3 + 5i
B. Complex number is: 5 + 3i
C. Complex number is: 9 + 25i
D. Complex number is: 3 - 5i
 

Tìm kiếm

Back
Top