Complex number:
Example :
2+3i
0+4i
-1-9i
These kind of number are known as complex number.
where 'i' is root -1.
Syntax-
a+bi
where,
'a' is the real part of the complex number
'b' is the imaginary part of the complex number.
Multiplication of two complex number:
x=3+4i
y=1+i
then x*y
=(3+4i)*(1+i)
=3+3i+4i-4
=-1+7i
program-
#include< stdio.h>
#include< string.h>
int main() {
int r1,i1,r2,i2,r,i;
printf("Enter real and imaginary part of first complex number\n");
scanf("%d%d",&r1,&i1);
printf("Enter real and imaginary part of second complex number\n");
scanf("%d%d",&r2,&i2);
r=r1*r2-i1*i2;
i=r1*i2+r2*i1;
printf("Multiplication is %d+%di",r,i);
}
Enter real and imaginary part of first complex number
1
2
Enter real and imaginary part of second complex number
3
4
Multiplication is -5+10i