Hi guys. I'm revising for an exam i have in a few weeks. I'm an electrical engineer and i struggle a fair bit with C programming. This question has popped up on a few of the past exams, so it may come up again. It asks for code to be inserted so that the outcome displays "x" for the user. I have no idea how to do it, even after scouring my notes. Any help would be greatly appreciated. thanks
Code:
struct Complex {float real; float imaginary;};
struct Complex Add(struct Complex a, struct Complex b);
void main()
{ struct Complex a,b,x;
a.real=10;
a.imaginary=10;
b.real=30;
b.imaginary=40;
x=Multiply(a,b);
/// add code here to display x for the user }***
struct Complex Multiply(struct Complex a, struct Complex b)
{
struct Complex c;
c.real=a.real*b.real- a.imaginary*b.imaginary;
c.imaginary= a.real* b.imaginary + a.imaginary *b.real;
return (c);
}