forked from SoumyadeepMukherjee/Matrix_Manipulation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMirror_Image.c
More file actions
33 lines (33 loc) · 714 Bytes
/
Mirror_Image.c
File metadata and controls
33 lines (33 loc) · 714 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
30
31
32
33
#include <stdio.h>
int main()
{
int r, i, j;
printf("Enter number of rows:");
scanf("%d", &r);
int a[r][r];
printf("Enter %d matrix elements:\n", r * r);
for (i = 0; i < r; i++)
{
for (j = 0; j < r; j++)
scanf("%d", &a[i][j]);
}
printf("Matrix Elements:\n");
for (i = 0; i < r; i++)
{
printf("\n");
for (j = 0; j < r; j++)
{
printf("%d\t", a[i][j]);
}
}
printf("\nMirror Image of Matrix:\n");
for (i = 0; i < r; i++)
{
printf("\n");
for (j = r - 1; j >= 0; j--)
{
printf("%d\t", a[i][j]);
}
}
return 0;
}