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...
Alice's ____ menu choice provides the basic arithmetic calculations of addition, subtraction, multiplication, and division.
A. Numeric B. Math C. Compute D. Duration
The first step in any cybersecurity process is to ____.
A. get it properly organized B. get as much information as possible C. make the controls as strong as possible D. move as fast as possible
To add BigInteger b1 to b2, you write _________.
a. b1.add(b2); b. b2.add(b1); c. b2 = b1.add(b2); d. b2 = b2.add(b1); e. b1 = b2.add(b1);
Case-Based Critical Thinking Questions ? Case 13-2 ? Michelle has defined a custom object by creating an object literal. She wants to access the properties of the custom object. Which of the following can help Michelle to access the properties of the custom object?
A. for…inloop B. Dot operator C. Prototype chain D. Base object