Solution Review: Multiply Array Elements by 3
Follow the step-by-step instructions to multiply array elements by 3.
We'll cover the following...
We'll cover the following...
Solution
Press the RUN button and see the output!
Explanation
We will iterate over each value in the array, arr, and multiply it by 3.
Line 24: To traverse the array, initialize a loop from the index, i = 0 to i = n-1.
Lines 27-29:
An array always fetches its base address or starting address. Therefore, arr will give us the address of the ...