DEV Community

Cover image for Arrays Basics
Romil Jain
Romil Jain

Posted on

2 1

Arrays Basics

In Arrays, we can store multiple items of the same type together.

int A[5]; → means that we have declared an array of size 5
when we count arrays we count from zero , so here count is represented by index.

count arrays

A[0]=14; → means we have stored 14 at index 0
A[1]=2; → means we have stored 2 at index 1

We can declare above array easily by using code blocks
int A[10]={3,5,6,7,8,9}; → this is called declaration + assigning the value

I would recommend you to study C language from GeekForGeeks and learn about structures

HINT :- To print all array values


for(int i=0;i<5;i++){
  printf("%d", A[i];
};

Enter fullscreen mode Exit fullscreen mode

Top comments (0)

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay