Product of Complex Numbers using three Multiplication Operation | Java program for the above approach ; Function to multiply Complex Numbers with just three multiplications ; Find value of prod1 , prod2 and prod3 ; Real Part ; Imaginary Part ; Print the result ; Driver Code ; Given four numbers ; Function call
class GFG { static void print_product ( int a , int b , int c , int d ) { int prod1 = a * c ; int prod2 = b * d ; int prod3 = ( a + b ) * ( c + d ) ; int real = prod1 - prod2 ; int imag = prod3 - ( prod1 + prod2 ) ; System . out . println ( real + " ▁ + ▁ " + imag + " i " ) ; } public static void main ( String [ ] args ) { int a = 2 ; int b = 3 ; int c = 4 ; int d = 5 ; print_product ( a , b , c , d ) ; } }