hey dear i need help in printing 2d array i can take input from user but cannot out put it please help
#include<iostre am>
using namespace std;
int main()
{int i,j,john[2][3]={{1,2,3},{5,6, 7}};
for(i=1;i<=2;i+ +){
for(j=1;j<=3;j+ +){
cout<<"input value of "<<i<<" and "<<j<<endl;
cin>>john[i][j];
}
system("pause") ;
return 0;
}
#include<iostre am>
using namespace std;
int main()
{int i,j,john[2][3]={{1,2,3},{5,6, 7}};
for(i=1;i<=2;i+ +){
for(j=1;j<=3;j+ +){
cout<<"input value of "<<i<<" and "<<j<<endl;
cin>>john[i][j];
}
system("pause") ;
return 0;
}
Comment