DEV Community

Cover image for Arrays Basics
Romil Jain
Romil Jain

Posted on

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)