Solved

An Array, Numbers, Has Been Declared and Initialized as Follows

Question 71

Essay

An array, numbers, has been declared and initialized as follows:
int [ ] numbers = { 45, 78, 99, 12, 66 };
What is the index of 78?
What is the array element at index 4?
Change the array so that we have value 77 instead of 99.
Swap the value at indexes 1 and 2 without knowing what the values are.
Using a loop, assume that you do not know how many elements are in the array and increase all the values of numbers by 10.
Using a loop, assume that you do not know how many elements are in the array and what they are, and calculate and output the number of elements that are strictly greater than 50.
Using a loop, assume that you do not know how many elements are in the array and output every other element of the array, starting at the first element.

Correct Answer:

verifed

Verified

The index of 78 is 1.
The array element ...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents