0
Program which accepts 2D array of integers and its size as arguments and displays the elements of middle row and middle column??
eg: if array is 3 5 4 7 6 9 2 1 8 output : middle row : 7 6 9 middle column : 5 6 1
1 Resposta
+ 1
void printMiddle(int[][] arr, int size){
int i = 0;
printf("middle row: ");
for (i=0;i<size;i++){
printf("%d ", arr[size/2][i];
}
printf("\nmiddle column: ");
for (i=0;i<size;i++){
printf("%d ", arr[i][size/2];
}
}