Write the definition of a function called product. The function receives two int parameters. You may assume that neither parameter is negative. The function returns the product of the parameters. So, product (3,5) returns 15 and product (30,4) returns 120. The function must not use a loop of any kind (for, while, do-while) to accomplish its job.

Write the definition of a function called product. The function receives two int parameters. You may assume that neither parameter is negative. The function returns the product of the parameters. So, product (3,5) returns 15 and product (30,4) returns 120. The function must not use a loop of any kind (for, while, do-while) to accomplish its job.

LANGUAGE: C++

CHALLENGE:

Write the definition of a function called product. The function receives two int parameters. You may assume that neither parameter is negative. The function returns the product of the parameters. So, product (3,5) returns 15 and product (30,4) returns 120. The function must not use a loop of any kind (for, while, do-while) to accomplish its job.

SOLUTION:



int product( int left, int right){
   return (left * right);
}

Add comment