Friday, 1 March 2013

Array in C Language


By on 04:57

Arrays in C Language:-Array is the collection of similar type of element.
Declaration of Array in C Programming:-

data type ARRAY NAME[Size of Array]

Example:-char arr[30];

Array index always start from 0 to n-1.Array can be access randomly.Size is always numeric.

Sample program of Array:-


Q)Write a program to create array and print it.



P:void main()

{
int arr[30];
printf("Enter array");
for(i=0;i<20;i++)
scanf("%d",&arr[i]);
printf("Array is-");
for(i=0;i<20;i++)
printf("%d",arr[i]);
getch();
}


If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...