Professional Documents
Culture Documents
A) Take Two Complex Numbers As Input and Compute Their Multiplication. (Here You Can Assume ALU Has The Multiplier)
A) Take Two Complex Numbers As Input and Compute Their Multiplication. (Here You Can Assume ALU Has The Multiplier)
#include <iostream>
using namespace std;
int mian()
{
int r1 = 0, c1 = 0, r2 = 0, c2 = 0, prod_r = 0,
prod_c = 0;
cout << "Enter the first complex number as a b"
<< endl;
cin >> r1>>c1;
cout << "Enter the second complex number as c d"
<< endl;
cin >> r2>>c2;
prod_r = r1*r2 - c1*c2;
prod_c = c1*r2 + r1*c2;