-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.c
44 lines (37 loc) · 838 Bytes
/
main.c
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
34
35
36
37
38
39
40
41
42
43
44
#include <stdio.h>
#include <stdlib.h>
int main()
{
int *arr[3],i,j;
for (i=0;i<3;i++)
{
arr[i] = (int *)malloc(4*sizeof(int));
}
printf("Enter the elements of the matrix\n");
for(i=0;i<3;i++)
{
for (j=0;j<4;j++)
{
printf("Enter the element in row%d and column%d",i,j);
scanf("%d",(*(arr+i)+j));
}
}
printf("\nthe matrix is as follows");
for(i=0;i<3;i++)
{
printf("\n");
for (j=0;j<4;j++)
{
printf("%d\t",*(*(arr+i)+j));
}
}
printf("\nthe address of elements of the matrix are as follows");
for(i=0;i<3;i++)
{
printf("\n");
for (j=0;j<4;j++)
{
printf("%d\t",(*(arr+i)+j));
}
}
}