2d array programs in c code example
Example 1: double array in c
int disp[2][4] = {
{10, 11, 12, 13},
{14, 15, 16, 17}
};
Example 2: c program to represent 2d matrix in 1d matrix
#include
#define n 3
int main()
{
int a[n][n],b[n*n],c[n*n],i,j,k=0,l=0;
printf(“\n Enter elements of 2D array : “);
for(i=0;i
Example 3: 2D Array In C
// Array of size n * m, where n may not equal m
for(j = 0; j < n; j++)
{
for(i = 0; i < m; i++)
{
array[i][j] = 0;
}
}