R6.4 Consider the following array: int a[] = { 1, 2, 3, 4, 5, 4, 3, 2, 1, 0 }; What are the contents of the array a afte

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

R6.4 Consider the following array: int a[] = { 1, 2, 3, 4, 5, 4, 3, 2, 1, 0 }; What are the contents of the array a afte

Post by answerhappygod »

R6.4 Consider the following array: int a[] = { 1, 2, 3, 4, 5, 4,3, 2, 1, 0 }; What are the contents of the array a after thefollowing loops complete?
a. for (int i = 1; i < 10; i++) { a = a; }
b. for (int i = 9; i > 0; i--) { a = a; }
c. for (int i = 0; i < 9; i++) { a = a[i + 1]; }
d. for (int i = 8; i >= 0; i--) { a = a[i + 1]; }
e. for (int i = 1; i < 10; i++) { a = a + a;}
f. for (int i = 1; i < 10; i = i + 2) { a = 0; }
g. for (int i = 0; i < 5; i++) { a[i + 5] = a[i]; }
h. for (int i = 1; i < 5; i++) { a[i] = a[9 - i]; }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply