Show the printout of the following code:

```#include
using namespace std;

void swap(int a[])
{
int temp = a[0];
a[0] = a[1];
a[1] = temp;
}

int main()
{
int a[] = {1, 2};
swap(a);
cout << "a[0] = " << a[0] << " a[1] = " << a[1] << endl;

return 0;
}
```

```
#include
using namespace std;

void swap(int a[])
{
int temp = a[0];
a[0] = a[1];
a[1] = temp;
}

int main()
{
int a[] = {1, 2};
swap(a);
cout << "a[0] = " << a[0] << " a[1] = " << a[1] << endl;

return 0;
}

a[0] = 2 a[1] = 1
```

Computer Science & Information Technology

You might also like to view...

Which of the following tips about text is not suggested in the Slide Show Design Principles?

A) Do not use underlined text. B) Use two spaces after punctuation in text blocks. C) Avoid using all capital letters. D) Use italics and bold sparingly.

Computer Science & Information Technology

In the equation: R = A + B * 2 – (C + 4) / A, the operands are:

a. +, *, -, / b. A, B, C c. R d. =

Computer Science & Information Technology