Add Two Complex Numbers
mediumQuestion 417A 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
Sign in to use hintsTopics
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.