C : Program of declaring and initializing 2D Array

--

Program :

//c program of declaring and initializing 2D Array

#include<stdio.h>

int main()
{
int arr[3][3] = {{3,4,5},
{5,6,3},
{3,9,7}
};

printf("2D Array Elements :\n");

for(int i=0; i<3; i++)
{
for(int j=0; j<3; j++)
{
printf("%d ", arr[i][j]);
}
printf("\n");
}

return 0;
}

Output :

--

--

Programmer Portfolio

Code enthusiast. Learning, practicing, and sharing my journey through various programming languages, one code at a time. 🚀💻