Array types with general formats in C

Types of the array in C Programming


  • Single Dimensional Array / One Dimensional Array.
  • Multi-Dimensional Array.


Single Dimensional Array -

We use the following general syntax for declaring and initializing a single dimensional array with size and initial values...

 datatype arrayName [ size ] = {value1, value2, ...} ;
int marks [6] = { 89, 90, 76, 78, 98, 86 } ;
Multi-Dimensional Array -
We use the following general syntax for declaring a two dimensional array...

datatype arrayName [ rowSize ] [ columnSize ] ;

int matrix_A [2][3] ;
In this 2 rows and 3 columns.
int A [2][3] = { {1, 2, 3},{4, 5, 6} } ;

Post a Comment

Previous Post Next Post