Array-Array is a collection of same type of data like (int, char,Float).Array is stored in Continuous Memory Location .
For Example:
int boy[5]={11,12,13,14,15,16};
In this Statement boy is an array consisting of 5 member/Element.Like
boy[0]=11;
boy[1]=12;
boy[2]=13;
boy[3]=14;
boy[4]=15;
boy[5]=16;
Note :Array index start with 0 ,So Array index always one less than Size of array.
//Program to Print Element of Array
#include <stdio.h>
int main()
{
int arr[6]={11,12,13,14,15,16};
int i;
for(i=0;i<6;i++)
{
printf("%d\n",arr[i]);
}
return 0;
}

c programming
For Example:
int boy[5]={11,12,13,14,15,16};
In this Statement boy is an array consisting of 5 member/Element.Like
boy[0]=11;
boy[1]=12;
boy[2]=13;
boy[3]=14;
boy[4]=15;
boy[5]=16;
Note :Array index start with 0 ,So Array index always one less than Size of array.
//Program to Print Element of Array
#include <stdio.h>
int main()
{
int arr[6]={11,12,13,14,15,16};
int i;
for(i=0;i<6;i++)
{
printf("%d\n",arr[i]);
}
return 0;
}
No comments:
Post a Comment