How to read and write data in 2-D array?

Data Structure >   Array >   Array Introduction in Data Structure  

Long Question

481


Answer:


#include <stdio.h>
void main()
{
int a[3][2];
int i,j;
for(i = 0;i<3;i++){
for(j=0;j<2 ;j++) {
a[i][j]=2;
}
}
for(i = 0;i<3;i++){
for(j=0;j<2;j++) {
printf("value in array %d\n",a[i][j]);
}
}
for(i = 0;i<3;i++){
for(j=0;j<2;j++){
printf("value in array %d and address is %8u\n", a[i][j],&a[i][j]);
}
}
}



This Particular section is dedicated to Question & Answer only. If you want learn more about Data Structure. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.