โ Back to Structs
Question 347
Add Two Complex Numbers
Add Two Complex Numbers
Astruct Complexhas integer fieldsre(real part) andim(imaginary part). Adda = {3, 2}andb = {1, 4}component-wise and print the result in the formre+imi: 4+6i Use the format string"%d+%di". There is no trailing newline.
Expected Output:
4+6i
Topics:
Structs
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.