Cpp Program 1
Cpp Program 1
class Complex {
private:
float real;
float imag;
public:
real = r;
imag = i;
cout << "Complex Number: " << real << " + " << imag << "i" << endl;
};
int main() {
c1.showValue();
c2.showValue();
resultAdd.showValue();
resultSub.showValue();
resultMul.showValue();
float scalar = 2;
cout << "Multiplying c1 by scalar " << scalar << ": ";
resultScalar.showValue();
return 0;
}`