Skip to content

Arrays #19

@vidishaverma89

Description

@vidishaverma89

array is a collection of items of the same type stored in contiguous memory locations.

defining arrays:
int a[]={1,2,3};
int b[10];
int c[3]={9,0,8};
int d[10]={0,9};
int e[3]={9,8,7,6,5};//Error

finding length of an array:
input : int n=sizeof(d)/sizeof(int);
printf("%d",n);

output : 10

for printing the numbers :
for(int i=0;i<=n-1;i++)
{
printf("%d,",a[i]);

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions