Your Only Destination To Empower Your Computer Programing Knowledge. Sky is not so high, You can Touch it if You Try

Array in C

Friends,
Good morning.
This article is about a concept of array in C language.
Array:-
Array is a set of similar type elements.it is an ordered set of elements stored at contigious location.Generally array is combination of rows and columns which is called its subscripts.It start from zero index.

TYPES OF ARRAY:-
Array are of two types based on dimensions:-
1.One dimension array.
2.Multidimension array.

ONE DIMENSION ARRAY:-
One dimension array is array type which contains one subscript.
Ex. A(2) A is a array name and it contains two elements 0 and 1 index value.

MULTIDIMENSION ARRAY:-
When array contains more than one subscript then it is called multidimension array.Array containing two subscript is also called two dimension array.
Ex A(2,3) A is an array which contains two subscript means 2 rows and 3 columns.Index always start from zero by default.

A Simple program to show use of array:-
#include
#include
Void main()
{
Int a(3);
Printf("enter the elements");
For(j=0;j<10;j++)
a[i]=j;
For(j=0;j<10;j++)
Printf("%d",&a[j]);
Getch();
}
This is a simple program of array in which ten elements in j store in array a on contigious location.
Friends this is the simple concept of array.Array can be used to show bubble sort,selection sort etc.
Thanks friends.
Stay in touch.

No comments:

Post a Comment