Computer Science, asked by kamsanpallipavithra1, 9 hours ago

what is array?explain the declaration and initialization of one dimensionaland two dimensional array with an example

Answers

Answered by ajmerkhan
9

Answer:

The declaration of an array involves defining the data types of the array elements as well as the number of elements to be stored in the array. A one-dimensional array stores elements sequentially. A two-dimensional array stores elements in rows and columns. A three-dimensional array is an array of arrays.

Explanation:

mark me as brainlist

Answered by aditijaink283
2

Answer:

The answer to the given question is explained in the explanation.

Explanation:

An array is defined as an ordered collection of similar data elements. All array data elements are stored in contiguous memory locations in RAM. The elements of an array have the same data type, and each element can be accessed using the same name.

Array Declare: We know that all variables are declared before they are used in our program. Similarly, if you want to use an array, you must first declare it. You must specify the size of the array when declaring it. The size used when declaring the array instructs the compiler to allocate and reserve the specified memory area.

Array initialization: -

Various initialization array types:

1. Compile time

(i) Initialization of all specified memory areas.

(ii) Initialize subarray

(iii) Initialize without specifying size.

(iv) String initialization.

2. At runtime

#SPJ2

Similar questions