This is a functional problem i.e. partial code is already done for you, invest time to study the locked code and complete the solution accordingly.
In this problem, you need to add 2 given complex numbers and print the resulting complex number using '+' operator.
Implement a class named complex containing data members as real and imaginary part of the complex number and the following function:
First line of the input contains the number of test cases and each test case contains 4 space separated integer values representing the real and imaginary part of 2 complex numbers ( Real1 imaginary 1 real2 imaginary2 )
The output to each test case should be a single line representing the resulting complex number from the addition of given complex numbers. In the given format
real + imaginary_i
for eg: 2 +3i
1 <= Test case <= 100
3 6 -1 4
2 2 -1 -1
2 + 10i
1 + 1i
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.