Complex Numbers Sum and Product

Programming Interview Medium 8 views
Back to Questions

Problem Description

Consider {x}. Create Complex class with add and mul. Output sum then product as 'x y' for real and imag.

Input Format

One line: a b c d.

Output Format

Two lines: sumReal sumImag then prodReal prodImag.

Sample Test Case

Input:
1 2 3 4
Output:
4 6 -5 10

Constraints

|values|

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next