Array is the collection of the same data type.
-It is possible to create an array of any type.
Syntax-
char array_name[size];
Example-
a=[1,2,3,4,5]
printf("%d",a[0]); //1
printf("%d",a[3]); //4
program-
#include< stdio.h>
int main()
{
int a[100],i;
printf("Enter 5 numbers\n");
//take input in array
for(i=0;i< 5;i++)
{
scanf("%d",&a[i]);
}
printf("Now we have 5 numbers in array\ni.e,n");
for(i=0;i< 5;i++)
{
printf("%d\t",a[i]);
}
return 0;
}
Enter 5 numbers
12 18 90 4 56
Now we have 5 numbers in array
i.e,
1218 90 4 56