Consider the following function and code segment.

```
void One( int first, int & second )
{
first = 17;
second = first + 1;
}
int main()
{
// other code ...
int j = 4;
int k = 3;
One(j, k);
// other code ..
}
```

After the call to One(j, k); what are the values of j and k? Why?
a) j == 4, k == 3;
b) j == 17, k == 18;
c) j == 4, k == 18;
d) j == 17, k == 3;


c) j == 4, k == 18;

The first parameter is called by value, so the parameter first is assigned 4 by the call. The parameter first is immediately assigned in the function, but the first argument is not changed, hence, j==4.
The second parameter is call-by-reference, so when first + 1 is computed to be 18, and is assigned to second, second is changed, and the corresponding argument, k is changed, hence, k==18.

Computer Science & Information Technology

You might also like to view...

If you want exact measurements for a text box, you can select the text box with the Selection tool and entered the width and height in the W and H text boxes on the Control panel.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Which of the following is NOT true about the Switchboard?

A) The navigation form has replaced the Switchboard. B) The Switchboard Manager can be launched by adding a command to the Quick Access Toolbar. C) The Switchboard is no longer available. D) The Switchboard can be run automatically in the Immediate window using a VBA command.

Computer Science & Information Technology

If you are trying to wrap text around a graphic and the text does not wrap, but instead leaves a big gap above or below the graphic, then one solution is to:

A) right click Text Wrapping and More Layout Options, click the Picture Position tab, and select Tight. B) choose Paragraph from the option menu, click Line and Page Breaks tab, and uncheck the Keep lines together option. C) choose Paragraph from the option menu, click Line and Page Breaks tab, and check the Keep lines together option. D) right click Text Wrapping and More Layout Options, click the Line and Page Breaks tab, and select Tight.

Computer Science & Information Technology

________ can be inserted into conditional formatting rules so that cells display formatting based on the results of those rules

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology