Question int[] style=”color:#000000;background-color:rgb(255,167,88);”>primes = { 2, 3, 5, 7, 11 }; Assume the array primes has been initialized . What does it contain after executing the following loop? for (int i = 0; i < 2; i++) { primes[4 – i] = primes[i]; } this is the answer of the book 2, 3, 5, 3, 2. Can someone please explain the process of thinking because my answer is 2,3,5 and I don't understand how we got the last two numbers.
Question
int[] style=”color:#000000;background-color:rgb(255,167,88);”>primes = { 2, 3, 5, 7, 11 };Assume the array primes has been initialized . What does it contain after executing the following loop?for (int i = 0; i < 2; i++){ primes[4 – i] = primes[i];}
this is the answer of the book 2, 3, 5, 3, 2. Can someone please explain the process of thinking because my answer is 2,3,5 and I don’t understand how we got the last two numbers.
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"
