196k views
0 votes
In a single statement: declare, create and initialize an array named a of ten elements of type int with the values of the elements (starting with the first) set to 10, 20, ..., 100 respectively.

1 Answer

4 votes

Answer:

int[] a = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100};

Step-by-step explanation:

//written in java

The left side int[] a Declare a variable(a) which is of type Integer array(int[]).

The equal sign(=) assign the right side to the left side.

The right side initialize the integer array(a) with ten element.

User Alexdriedger
by
6.0k points