
if C1 = 4 + i5 and C2 = 3 +i1
C1.plus(C2) results in:
C1 = 7 + i6 and C2 = 3 + i1
if C1 = 4 + i5 and C2 = 1 + i2
C1.multiply(C2) results in:
C1 = -6 + i13 and C2 = 1 + i2
a + ib
The first line of the input contains two integers - real and imaginary part of 1st complex number.
The second line of the input contains Two integers - the real and imaginary part of the 2nd complex number.
The first line of the input contains an integer representing choice (1 or 2) (1 represents plus function will be called and 2 represents multiply function will be called)
The only line of the output prints the complex number in the following format a + ib
In this problem, we have to add or multiply the given complex numbers based on the choice.
e.g.
if C1 = 4 + i5 and C2 = 3 +i1
C1.plus(C2) results in:
C1 = 7 + i6 and C2 = 3 + i1
e.g.
if C1 = 4 + i5 and C2 = 1 + i2
C1.multiply(C2) results in:
C1 = -6 + i13 and C2 = 1 + i2
And finally, we create a print function that prints the result in the complex number form.
Count vowels, consonants, and spaces
King Placement
No Repeated Digits
No Repeated Digits
Smit’s String Flip Game.
Longest Alternating Subarray