What are the contents of the array after the subsequent


Question: What are the contents of the array after the subsequent loops complete?

1) for (int i = 1; i < 10; i++) { a [i] = a[i - 1]; }
2) for (int i = 9; i > 0; i--) { a [i] = a[i - 1]; }
3) for (int i = 0; i < 9; i++) { a [i] = a[i + 1]; }

Should not the answer for question 1 and 2 be all 1s? What about question 3?

Give the output of given for loops and also provide the iteration how to get it.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: What are the contents of the array after the subsequent
Reference No:- TGS0949079

Expected delivery within 24 Hours