array in C Language, C programming language, coaching class in Ahmedabad, coahcing for c, computer coaching in India, computer coaching in satellite-ahmedabad, online coaching for array in c language, TCCI computer coaching

Array in C Programming Language – tccicomputercoaching.com

What is Array?

Array is collection of more than one element of same type at a same memory location.

Array-in-C-Prog_simple

Declaration Syntax:

Data Type arrayname[size];

Here , size represent number elements stored in Array. This size is maximum
so, user can enter equal or less elements but nor more than elements.

All Elements store in sequence in memory. An each element contain position
which always start from zero.

rn[0]

rn[1]

rn[2]

rn[3]

0 1 2 3

For Example , if we want to store 4 student rollno at a same location then
array has been declared like this:

int rn[4];

Advantage:

Variable cannot store more than one data at a time. Array removes this
limit of variable.

Disadvantage:

Array can store an elements of same type only.

To enter data in given an array:

for(i=0;i<n;i++)

{

Scanf (“%d”,a[i]);

}

To display data in given an array:

For (i=0;i<n;i++)

{

Printf (“%d”,a[i]);

}

We can find maximum element , minimum element , sort the array , search an element from an Array.

To learn coding in C  Language at TCCI

Call @ 9825618292

Visit @ http://tccicomputercoaching.com/