Interview Solution

Don’t worry if it doesn’t work right. If everything did, you’d be out of a job. Mosher’s Law

Complex number

Language Java | Level Intermediate | Category Interview Problems | July 24, 2015 4:52 pm

Comments


Interview Problem

A complex number is a combination of real and imaginary numbers. A+Bi is a complex number where A is the real number and B is the imaginary number.
A complex number is a number that can be expressed in the form a + bi, where a and b are real numbers and i is the imaginary unit,
Example:-
3+4i
3 - real number
4 - imaginary number


Output

   					 
Add:8.0+6.0i + 4.0+5.0i = 12.0+11.0i
Subtract:8.0+6.0i - 4.0+5.0i = 4.0+1.0i
Multiply:8.0+6.0i * 4.0+5.0i = 2.0+64.0i

				    

Comments



Please login to add comments.