Menu

Arrays in C Programming

  • Array refers to a named list of a finite number of similar data elements.
  • An array is a collection of the same type of data referenced by a common name.
  • It is a collection of contiguous memory locations referenced by a common name.
  • An array is a sequence of the data items of homogeneous value(same type).
  • Each of the data elements can be referred by a set of consecutive numbers, usually 0, 1, 2, 3, 4, ………,n.

Examples

  1. Percentage mark of 100 students.
  2. The number of chairs in a home.
  3. Ages of 25 students.

Types of Array

  1. One dimensional array
  2. Two-dimensional arrays (Multidimensional arrays).

One dimensional array

  • It is the simplest form of an array that can store a linear set of values with one subscript or one index.

Syntax

      DATATYPE ARRAYNAME[SIZE];