Array:-An Array is a technique of storing more then one value in to a single variable.This variable is basically an array of different contegous memory location can hold a discte value.
Upon the basis of usage, array are of following three types-
1– One Dimentional
2– Two Dimentional
3– Multi Dimentional
1– One Dimentional Array:-A 1D array is nothing but simple straight array.
Decleration:- Data type arrayname [array-length];
Exaple – int arr[5];
It will reserve a memory like this-

Initialization:-
i)– via assignment:- int a[5];
a[5]={3,4,6,7,9};
ii)– via scanf():-for(i=0;i<=4;i++)
{
scanf(“%d”,&a[i]);
}
Que.1-: Write a program that input an integer array of 5 element and display is its content.
via assignment:-
#include< stdio.h>
#include< conio.h>
void main()
{
int a[5];
clrscr();
a[5]={1,3,5,8,6};
printf(“%d%d%d%d%d”,a[0],a[1],a[2],a[3],a[4]);
getch();
}

via scanf():-
#include< stdio.h>
#include< conio.h>
void main()
{
int a[5],i;
clrscr();
printf(“Enter five number”);
for(i=0;i<=4;i++)
{
scanf(“%d”,&a[i]);
}
printf(“Following are your element”);
for(i=0;i<=4;i++)
{
prointf(“%d”,a[i]);
}
getch();
}

Finding maximum in an array:-
#include< stdio.h>
#include< conio.h>
void main();
{
int a[5],I,max=-32768;
printf(“enter 5 elements :”);
for(i=0;i<5;i++)
{
sacnf(“%d”,&a[i]);
}
for(i=0;i<5;i++)
{
if(a[i>max])
{
max=a[i];
}
printf(“The maximum is %d”,max);
getch();
}

Sorting an array:-
i)– Selection Sorting:-
#include< stdio.h>
#include< conio.h>
void main()
{
int a[5],I,j,t;
printf(“Enter 5 elements”);
for(i=o;i<5;i++)
{
scanf(“%d”,a[i]);
}
for(i=0;i<5;i++)
{
for(j=i+1;j<5;j++)
{
if(a[j] {
t=a[j];
a[j]=a[i];
a[i]=t;
}
}
}
for(i=0;i<5;i++)
{
printf(“%d”,a[i]);
}
getch();
}

ii)– Bubble Sorting:–
#include< stdio.h>
#include< conio.h>
void main()
{
int a[5],I,j,t;
printf(“Enter 5 elements”);
for(i=0;i<5;i++)
{
scanf(“%d”,a[i]);
}
for(i=0;i<5;i++)
{
for(j=i+1;j<5;j++)
{
if(a[j]>a[j+1])
{
t=a[j];
a[j]=a[i];
a[i]=t;
}
}
}
for(i=0;i<5;i++)
{
printf(“%d”,a[i]);
}
getch();
}