#include<iostream.h>
#include<conio.h>
main( )
{
clrscr();
constint r=3;
constint c=3;
int array[r][c],i,j;
cout<<"\n Enter the contents of the 2D array row by row are :\n"<<endl;
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
cin>>*(*(array+i)+j);
cout<<endl;
}
clrscr();
cout<<"\n The content of the 2D array row by row are :\n"<<endl;
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
cout<<" array element ["<<i<<"]["<<j<<"] = "<<
*(*(array+i)+j)<<endl;
cout<<endl;
}
getch();
return 0;
No comments:
Post a Comment