This C program performs complex number multiplication. This program generally demonstrates the arithmatic operations on complex numbers.

Here is the source code of the C program to multiply two complex numbers. The C program is successfully compiled and run on a Linux system. The program output is also shown below.

`/*`

`* C Program to perform complex number multiplication`

`*/`

`#include<stdio.h>`

typedef struct COMPLEX{

int a;

int b;

}Complex;

Complex multiply(Complex, Complex);

int main(){

int a1, b1, a2, b2;

Complex x, y, z;

printf("Enter first complex number : ");

scanf("%d+%di", &a1, &b1);

printf("\nEnter second complex number : ");

scanf("%d+%di", &a2, &b2);

x.a = a1;

x.b = b1;

y.a = a2;

y.b = b2;

z = multiply(x, y);

printf("\nAfter multiplication: %d+%di", z.a, z.b);

return 0;

`}`

Complex multiply(Complex x, Complex y){

`Complex z;`

z.a = x.a * y.a - x.b * y.b;

z.b = x.a * y.b + x.b * y.a;

return z;

`}`

$ gcc complex.c -o complex $ ./complex Enter first complex number : 2+1i Enter second complex number : 2+1i After multiplication: 3+4i

**Sanfoundry Global Education & Learning Series – 1000 C Programs.**

Here’s the list of Best Reference Books in C Programming, Data Structures and Algorithms.