Simranjit
2 min readFeb 9, 2022

--

C ARRAYS-FORMAT CONCEPT PROGRAM AND EXAMPLE

A particular element in an array is accessed by an index. The lowest address corresponds to the first element and the highest address corresponds to that element. In this article, you will learn about C arrays-format concept program and example.

WHAT IS C ARRAYS-FORMAT CONCEPT PROGRAM AND EXAMPLE

An array is a series of elements of the same type placed in contiguous memory locations. It can also be defined as a variable that holds multiple elements which have the same data type.

“An array is a homogeneous set of data”

Example: — you can store 4 variables of data type int in an array without having to declare different variables, each one with a different identifier. Instead of that, using an array, we can store 4 different values of the same type.

An array which contains 4 integer values of type int called Roll no could be represented like this:

Roll no [0] Roll no[1] Roll no[2] Roll no[3]

10203040

Where each integer represents an element of the array. These elements are numbered from roll no[0] to roll no[4] because in arrays the first index is always 0. The index is also known as subscript number.

Before using array in C program, it must be declared.

ONE DIMENSIONAL ARRAY DECLARATION IN C

An array can be declared by giving its name, number of elements, and the data type of elements.

Syntax: — the syntax of declaration of an array is as follows:-

data_type array_name[no. of elements];

E.g. int a[10];

The above given declaration means that an array of name has 10 elements and each

CONTINUE

--

--

Simranjit
0 Followers

well! I am a teacher as well as blogger. I am very fond of providing the knowledge related to study so that's is the platform through which I share my knowledge