Getting Started With C

Two-Dimensional Arrays

Two-Dimensional Arrays

Initialisation of two dimensional array

Resources :

Test Your Knowledge
Choose The

With supporting text below as a natural lead-in to additional content.

Q1. What will be the output of the following C code?

   #include 
int main()
{
int ary[2][3];
ary[][] = { {1, 2, 3}, {4, 5, 6} };
printf("%d\n", ary[1][0]);
}

Q2. What is the output of C program with multidimensional array.?
int main()
{
int ary[3][2] = {1,2,3,4,5,6};
printf("%d %d", ary[0][0], ary[2][1]);
return 0;
}