Write a definition for a void-function that has two int value parameters and outputs to the screen the product of these arguments. Write a main function that asks the user for these two numbers, reads them in, calls your function, then terminates.
What will be an ideal response?
```
//file: testProblem.cc
//illustrates value parameters in a void-function,
//fetching values, and the calling of that function
//to multiply and display arguments.
#include
using namespace std;
void func(int x, int y)
{
cout << x * y << endl;
return;
}
int main()
{
int f, g;
cout << "Enter two integers, I'll return the product.&endl;
cin >> f >> g;
func(f, g);
return 0;
```
You might also like to view...
A(n) ________ is a program which reads the instructions programmers have written and translates these instructions into binary patterns that will execute commands on the CPU
Fill in the blank(s) with correct word
Given a linked list (using the code from the book) and assuming there are at least two nodes in the list, which of the following sets of statements would implement a function to return and remove the last item in the list?
a. NodePtr here; here=head; while(here->link != NULL) { here = here ->link; } return here->data; delete here; b. NodePtr here; here=head; while(here->link != NULL) { here = here ->link; } delete here; return here->data; c. int tmp; NodePtr here, there; here=head; while(here->link != NULL) { there = here; here = here ->link; } there->link = NULL; tmp=here->data; delete here; return tmp; d. int tmp; NodePtr here, there; here=head; while(here->link != NULL) { there = here; here = here ->link; } there->link = NULL; tmp=here->data; return tmp; delete here;