Write a program to find the product of 2 power numbers if the base and the exponent of these numbers are
provided in the main function, also check that the base of both the power number are the same, as the
product of 2 power numbers can only be calculated if their base is the same. Use pass by reference
mechanism to compute the product of these power numbers then display the result in main function.
Note: Your function should not return a value.
int main()
{
double a, b, c ,d;
double res;
cin >> a >> b;
cin >> c >> d;
res = pow(a, b) * pow(c, d);
}
Comments
Leave a comment