Page 1 of 1

Create a C program that adds two complex numbers. The numbers are entered from the keyboard. Your code should use the fo

Posted: Tue Apr 12, 2022 10:25 am
by answerhappygod
Create A C Program That Adds Two Complex Numbers The Numbers Are Entered From The Keyboard Your Code Should Use The Fo 1
Create A C Program That Adds Two Complex Numbers The Numbers Are Entered From The Keyboard Your Code Should Use The Fo 1 (303.94 KiB) Viewed 44 times
Please write the code in c .
Create a C program that adds two complex numbers. The numbers are entered from the keyboard. Your code should use the following structure to store complex numbers. typedef struct complex s { float real: float imag; } complex; Your code needs to incorporate one function for the addition and one function for the proper printing of the complex number. The function prototypes are given as follows. complex addComplex (complex zi, complex z2); // z3=z1+z2 returns z3 void printcit omplex (complex z);/* prints a complex number on the screen Sample Output 1 Enter the real and imaginary parts of the first number: 5.5 3.4 Enter the real and imaginary parts of the second number: 8.9 5.9 15.5-3.4) - 8.9-5.9) = (14.4-9.31) Sample Output 2 Enter the red and imaginary parts of the first number: 5.2 3.3 Enter the red and imaginary parts of the second number: 8.9-3.3 15.2-3.3i) + 8.9-3.31) = 14.1 Sample Output 3 Enter the real and imaginary parts of the first number 5.5 34 Enter the real and imaginary parts of the second number 8.9-59 5.5-3.41) + (8.9-5.91) = (14.4-2.5i)