Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrays #19

Open
vidishaverma89 opened this issue Aug 12, 2023 · 0 comments
Open

Arrays #19

vidishaverma89 opened this issue Aug 12, 2023 · 0 comments

Comments

@vidishaverma89
Copy link

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]);

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant