What are the values in the array after execution of the following code?

int a[4] = {3, 7, 6, 2};
int i = 2;
a[i] = i + 1;
a[i + 1] = a[ i – 1];
a[1] = 5;

a) 5, 3, 3, 6
b) 3, 5, 3, 7
c) 5, 7, 3, 7
d) 5, 7, 2, 1


b) 3, 5, 3, 7

Computer Science & Information Technology

You might also like to view...

If an attacker wishes to collect confidential financial data, passwords, PINs and any personal data stored on your computer which of the following programs would they choose to use?

A. Adware B. Spybot C. Malware D. Spyware

Computer Science & Information Technology

The while statement is an indefinite loop.

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

Computer Science & Information Technology

The purpose for array initialization is:

A. to provide default values so that data manipulation can proceed without null errors. B. used when you need to keep all values in the array the same through program execution. C. not needed as C++ automatically initializes values upon array creation. D. helpful when declaring the data type for the array.

Computer Science & Information Technology

A family has three children. Assuming independence, find the probability that the youngest child is a boy and the older children are girls.

A.
B.
C.
D.
E.

Computer Science & Information Technology