Declare an integer array that can hold up to 10 integer values. In a for loop, initialize the integer array with the fir
Posted: Sun Jul 10, 2022 11:27 am
Declare an integer array that can hold up to 10 integer values. In a for loop, initialize the integer array with the first 10 natural numbers (excluding 0). Integer 1 at index 0, integer 2 at index 1 and so forth. In a second for loop, compute the cumulative sum of the first 10 natural numbers and store it in a variable called sum. Display a message with the sum of the first 10 natural numbers using printf. Compile the program and rename the executable as sum.