I have an assignment in which i have to add, subtract, multiply and divide two complex numbers and i am very confused as to how to create the program.
This is what i have got so far..
#include <stdio.h>
#include <complex.h>
int main (void)
int real, imag;
{
complex a, b, c, d;
printf("Please enter the two real and imaginary complex numbers (a+jb) :\n")
printf("a = \n");
scanf("%d", &a.real);
printf("b = \n");
scanf("%d", &b.imag);
printf("Please enter the next two real and imaginary complex numbers (c+jd) :\n")
printf("c = \n");
scanf("%d", &c.real);
printf("d = \\n");
scanf("%d", &d.imag);
}
obviously i don't know if this is right but i am hoping so, now i don't know how to write the expression for adding the two complex numbers or outputting the end value.