In: Computer Science
#include <stdio.h>
// main function
int main()
{
// declare the array
int hello[5][10];
// to print the element at fifth row and seventh column we print
the element at [5-1][7-1] i.e. [4][6] index because the index
starts from [0][0]
printf("Element at 5th row and 7th column :
%d\n",hello[4][6]);
// the output will be some garbage value because we have not
populated the array yet
// now lets populate the array with some values
for(int i=0;i<5;i++)
{
for(int j=0;j<10;j++)
{
hello[i][j]=i+j;
}
}
// now print the value at fifth row and seventh column it should
print (5-1) + (7-1) = 4 + 6 = 10
printf("Element at 5th row and 7th column :
%d\n",hello[4][6]);
return 0;
}