0% found this document useful (0 votes)
6 views1 page

Array

The document discusses arrays, which are collections of related data stored in adjacent memory locations. Arrays can store primitive data types and there are one-dimensional and multi-dimensional arrays. A one-dimensional array example is shown with data and indexes.

Uploaded by

Amidu Mansaray
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Array

The document discusses arrays, which are collections of related data stored in adjacent memory locations. Arrays can store primitive data types and there are one-dimensional and multi-dimensional arrays. A one-dimensional array example is shown with data and indexes.

Uploaded by

Amidu Mansaray
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

31/10/23

ARRAY: An array is a collection of a related data items stored in adjacent memory locations.
The element of an array can be accessed using its index. Array can store a collection of any of
the primitive data type including int, double, floot, charl etc.

There are two main types of arrays:

➢ One dimensional array


➢ Multi-dimensional array

One dimensional array – this is the simplest form of array which uses the row format in storing
information.

Data 9 4 5 7

0 1 2 3

Location (Index)

Index = Count – 1

Syntax: Datatype ArrayName [size] = {loc1, loc2, loc3, loc4};

Location (Index)

Assignment:

Create a one-dimensional array of 15 positive integer even numbers from 2 to 30

You might also like