CJCoding With Joseph
15free / daySign inCreate account

Add Two Complex Numbers

A struct Complex has integer fields re (real part) and im (imaginary part). Add a = {3, 2} and b = {1, 4} component-wise and print the result in the form re+imi (see Expected Output).

Use the format string "%d+%di". There is no trailing newline.

Expected Output:

4+6i

= newline. No newline after the last line.

Hints4 available
Topics:
Structs
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.