-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharraymirror.c
More file actions
29 lines (29 loc) · 764 Bytes
/
Copy patharraymirror.c
File metadata and controls
29 lines (29 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include<stdio.h>
int main(){
int rows,column;
printf("enter num of rows of array\n");
scanf("%d",&rows);
printf("enter num of columns of array\n");
scanf("%d",&column);
int arr[rows][column];
printf("enter the elements in 2d array\n");
for (int i=0;i<rows;i++){
for (int j=0;j<column;j++){
scanf("%d",&arr[i][j]);
}
}
printf("\nthe 2d array /matrix is:\n\n");
for (int i=0;i<rows;i++){
for (int j=0;j<column;j++){
printf("%d ",arr[i][j]);
}printf("\n");
}
//mirror
printf("the mirror matrix is:\n");
for (int i=0;i<rows;i++){
for (int j=column-1;j>=0;j--){
printf("%d ",arr[i][j]);
}printf("\n");
}
return 0;
}