Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Declare an array to hold 4 integers and fill it with the numbers 2, 4, 6, and

ID: 3653842 • Letter: 1

Question

1. Declare an array to hold 4 integers and fill it with the numbers 2, 4, 6, and 8.


2. Assume an array called AR contains 4 integers. Write a loop to print out the values of the 4 integers.


3. Assume an array called AR contains 4 integers. Write code to exchange the very first and the very last values in the array.


4. Declare an array to hold 1000 integers. In the declaration statement, initialize the array so the very first value is 10, the second is 20, and all the rest are 0.


5.Completethe following sentence: If you declare an array to hold N values, legal subscripts run from _____ to _____


6. Complete thefollowingsentence: the unsubscripted name of an array is _______________________________.

Explanation / Answer

// arrays example #include using namespace std; int billy [] = {16, 2, 77, 40, 12071}; int n, result=0; int main () { for ( n=0 ; n