complex number using structures

Complex numbers have the form realPart + imaginaryPart * i. Both realPart and imaginaryPart are integers. Write C++ code below to define a complex structure with two integer variables – realPart and imaginaryPart.

Write a C++ program to do the following:

a. Define a 5-elements array of complex number.

b. Define a function called inputdata(array, size) to ask user to input integers for those 5 complex numbers and store into the array.

c. Define a function called displaydata(array,size) to display the information of the array of the complex numbers. You can display the number as (realPart, imaginaryPart) instead of realPart + imaginaryPart * i
Do you have a question? What don't you understand?

What do you have so far?

With some more details about what specifically you're struggling with, we will better be able to help you.
Topic archived. No new replies allowed.