Page 1 of 1

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
by answerhappygod
Declare An Integer Array That Can Hold Up To 10 Integer Values In A For Loop Initialize The Integer Array With The Fir 1
Declare An Integer Array That Can Hold Up To 10 Integer Values In A For Loop Initialize The Integer Array With The Fir 1 (37.04 KiB) Viewed 63 times
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.