diff --git a/C++/AddAndMultiplyTwoComplexNumbers.cpp b/C++/AddAndMultiplyTwoComplexNumbers.cpp new file mode 100644 index 0000000..1e80c3a --- /dev/null +++ b/C++/AddAndMultiplyTwoComplexNumbers.cpp @@ -0,0 +1,55 @@ +//C++ program to add and multiply two complex numbers + +#include +#include + +//Creating class Complex +class Complex +{ + public: + int real, img; + + //add function to add two matrices + void add(Complex c1, Complex c2) + { + int x, y; + x = c1.real + c2.real; + y = c1.img + c2.img; + cout<<"\n("<>a.real>>a.img; + cout<<"\nEnter real and imaginary part of second complex number:"; + cin>>b.real>>b.img; + c.add(a, b); + d.multiply(a, b); + cout<<"\n++("<