#include <iostream>
using namespace std;
struct complex {
double real;
double imag;
};
complex add(complex num1, complex num2);
int main() {
complex num1, num2, sum;
cout << "Enter the real and imaginary parts of the first complex number: ";
cin >> num1.real >> num1.imag;
cout << "Enter the real and imaginary parts of the second complex number: ";
cin >> num2.real >> num2.imag;
sum = add(num1, num2);
cout << "Sum = " << sum.real << " + " << sum.imag << "i" << endl;
return 0;
}
complex add(complex num1, complex num2) {
complex temp;
temp.real = num1.real + num2.real;
temp.imag = num1.imag + num2.imag;
return temp;
}