#include <iostream>
using namespace std;
class Complex{
float real, imaginary;
public:
Complex(){}
Complex(float a, float b): real(a), imaginary(b){}
void Display(){
cout<<real;
if(imaginary != 0) cout<<" + "<<"i";
if(imaginary < 0) cout<<"("<<imaginary<<")";
else cout<<imaginary;
}
Complex operator+(const Complex &other){
return Complex(this->real + other.real, this->imaginary + other.imaginary);
}
Complex operator*(const Complex &other){
return Complex(this->real * other.real + this->imaginary * other.imaginary, this->real * other.imaginary + this->imaginary * other.real);
}
};
Comments
Dear Shashank Tirkey, there is no main()
Undefined reference to 'winmain' Error is showing with Id returned 1 exit status
Leave a comment