Placing numbers inside braces and separating them by commas will assign a default value to each respective element number.
Second way to initialize your array elements is to use looping structures such as the for loop. To demonstrate, examine the following program code.
From example, It’s declared two variables, one integer variable called x, which is used in the for loop, and one integer-based array called iArray. Because array have five elements, It need to iterate five times for loop.