Question: (complex_number.cpp) We can multiply two complex numbers by using the following formula: product of complex number = (x + yi)(u + vi) Where (x +

(complex_number.cpp) We can multiply two complex numbers by using the following formula: product of complex number = (x + yi)(u + vi) Where (x + yi) is the first complex number and (u + vi) is the second imaginary number. We can solve the formula by multiplying the terms and simplifying them. Write a C++ program that prompts the user to enter two complex numbers (the first number is x and the second number is y) and calculates the product of them. Hint: i2 = - 1. See here for an example and formula. Here is a sample run: Enter the first complex number (real number followed by imaginary number): 32 Enter the second complex number (real number followed by imaginary number): 1 The product of 3 + 2i and 1 + 4i is -5 + 14i The inputs can have decimal numbers. Check showpos and noshowpos to help you print the + and - sign
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
