C++ One dimensional array

An array which has only one subscript is known as a one dimensional array.

Syntax:

Array declaration

Array initialization

Accessing array

An element of an array can be accessed by its index number. And that is done by placing the index number of the required elements within the square brackets ‘[]’ after the array name.

An Example showing One dimensional array

Output