49. WRITE A C PROGRAM TO INITIALIZE A SINGLE DIMENSIONAL ARRAY

/*program to initialize a single dimensional array*/

#include<stdio.h>
#include<conio.h>
int main()
{
int a[4]={1,2,3,4};
clrscr();
printf(“zeroth location elemrnt=%d”,a[0]);
printf(“first location elemrnt=%d”,a[1]);
printf(“second location elemrnt=%d”,a[2]);
printf(“third location elemrnt=%d”,a[3]);
getch();
return 0;
}

output

display array elements
zeroth location element=1
first location element=2
second location element=3
third location element=4

Comments