asked 142k views
3 votes
Assume that an array of integers named a that contains exactly five elements has been declared and initialized. Write a single statement that assigns a new value to the first element of the array. This new value should be equal to twice the value stored in the last element of the array. Do not modify any values in the array other than the first element.

asked
User Gerwitz
by
7.4k points

1 Answer

3 votes

array[0] = 2 * array[4];

answered
User FlappySocks
by
8.2k points