+ 2
How to display the border elements of a 2 d array.
just to display the elements at the sides of 2D array.. in 2D format.. WITHOUT STRING HEADER FILE..
2 Réponses
+ 1
like for A[n][n]
for(i=0;i<n;i++)
{ for(j=0;j<n;j++)
if((i==0||j==0)||((i==n-1)||(j==n-1))
cout<<A[i][j];
}
all the elements on the border will be printed
0
thank you very much dhairya...