Write a C program that utilizes the ComplexNumber data type defined below, ----- Start of Data Type Definition ----- typedef struct _ComplexNumber { double real; // real part double imag; // imaginary part } ComplexNumber; ----- End of Data Type Definition ----- The following behavior should be implemented: Declare three ComplexNumber variables Initialize the first complex variable as follows: ---->> real part = 0.5, imaginary part = -0.5 ---->> Print the initialization info on the screen Initialize the second complex variable as follows: ---->> real part = -1.75, imaginary part = 0.5 ---->> Print the initialization info on the screen Calculate the sum of the first and second complex variables ---->> Store the results in the third complex variable ---->> Print the results on the screen Calculate the difference, i.e., first complex number minus second complex number ---->> Store the results in the third complex variable ---->> Print the results on the screen Calculate the product of the first and second complex variables ---->> Store the results in the third complex variable ---->> Print the results on the screen Calculate the quotient, i.e., first complex number divided by the second complex number ---->> Store the results in the third complex variable ---->> Print the results on the screen Program exits. Refer to the figure below for the output of the program on the screen / console.
Write a C program that utilizes the ComplexNumber data type defined below,
----- Start of Data Type Definition -----
typedef struct _ComplexNumber {
double real; // real part
double imag; // imaginary part
} ComplexNumber;
----- End of Data Type Definition -----
The following behavior should be implemented:
- Declare three ComplexNumber variables
- Initialize the first complex variable as follows:
---->> real part = 0.5, imaginary part = -0.5
---->> Print the initialization info on the screen
- Initialize the second complex variable as follows:
---->> real part = -1.75, imaginary part = 0.5
---->> Print the initialization info on the screen
- Calculate the sum of the first and second complex variables
---->> Store the results in the third complex variable
---->> Print the results on the screen
- Calculate the difference, i.e., first complex number minus second complex number
---->> Store the results in the third complex variable
---->> Print the results on the screen
- Calculate the product of the first and second complex variables
---->> Store the results in the third complex variable
---->> Print the results on the screen
- Calculate the quotient, i.e., first complex number divided by the second complex number
---->> Store the results in the third complex variable
---->> Print the results on the screen
Program exits.
Refer to the figure below for the output of the program on the screen / console.
![First complex number initialized:
real part = 0.500000
imaginary part
= -0.500000
Second complex number initialized:
real part = -1.750000
imaginary part
= 0.500000
Sum of the first and second complex numbers:
real part = -1.250000
imaginary part
= 0.000000
First complex number minus second complex number (difference):
real part = 2.250000
imaginary part = -1.000000
Product of the first and second complex numbers:
real part = -0.625000
imaginary part = 1.125000
First complex number divided by second complex number (quotient):
real part
= -0.339623
imaginary part 0.188679
Process exited after 0.04866 seconds with return value 0
Press any key to continue](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F0d0257b1-71a2-401f-baa5-180a2271d67d%2Fd2206cfb-aca9-4668-a1ff-a3f4df517210%2Ft5aet4_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)