Write a definition for a void function that has three arguments of type int
and that outputs to the screen the product of these three arguments. Put
the definition in a complete program that reads in three numbers and
then calls this function.
void product_out(int n1, int n2, int n3);
int main( )
{
using namespace std;
int num1, num2, num3;
cout << "Enter three integers: ";
cin >> num1 >> num2 >> num3;
product_out(num1, num2, num3);
return 0;
}
void product_out(int n1, int n2, int n3)
{
using namespace std;
cout << "The product of the three numbers "
<< n1 << ", " << n2 << ", and "
<< n3 << " is " << (n1*n2*n3) << endl;
}