Define a function named swap that exchanges the values of its two type double input/output parameters. For example, if x = 2.2 and y = 3.3, after the call swap( x, y ); x would be 3.3 and y would be 2.2.

What will be an ideal response?


```
void swap (double& arg1, double& arg2)
{
double temp;
temp = arg1;
arg1 = arg2;
arg2 = temp;
}
```

Computer Science & Information Technology

You might also like to view...

Given the following code, how many times per second will the TimerListener event be generated?

Timer timer = new Timer(1000, new TimerListener()); A) 1 B) 10 C) 100 D) 1000

Computer Science & Information Technology

To bear the UNIX trademarked name, an operating system must conform to ________.

a) POSIX b) SUS c) LSB d) none of the above

Computer Science & Information Technology

After highlighting or selecting text, a user can use any of the following methods to place selected text in the clipboard, EXCEPT ________

A) right-click, Copy B) Home, Copy C) File, Copy D) CTRL + C

Computer Science & Information Technology

Which element will you never find in a calculated field?

A) Macro B) Arithmetic operator C) Function D) Constant

Computer Science & Information Technology