/* SHOW THE ADDRESS OF ANY ELEMENT (Aij) OF MATRIX:*/
#include<stdio.h>
int main()
{
int a[2][3][4];
int i,j,k,n;
printf("Enter the element in the muldimensional Array:-\n");
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
for(k=0;k<4;k++)
{
scanf("%d",&a[i][j][k]);
}
}
}
printf("Enter the element to find the address in the array:-");
scanf("%d",&n);
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
for(k=0;k<4;k++)
{
if(a[i][j][k]==n)
{
printf("Address of %d=%p",n,&a[i][j][k]);
}
}
}
}
// return 0;
getch();
}
OUTPUT:-
Enter the element in the muldimensional Array:-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Enter the element to find the address in the array:-5
Address of 5=0022FEF0
#include<stdio.h>
int main()
{
int a[2][3][4];
int i,j,k,n;
printf("Enter the element in the muldimensional Array:-\n");
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
for(k=0;k<4;k++)
{
scanf("%d",&a[i][j][k]);
}
}
}
printf("Enter the element to find the address in the array:-");
scanf("%d",&n);
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
for(k=0;k<4;k++)
{
if(a[i][j][k]==n)
{
printf("Address of %d=%p",n,&a[i][j][k]);
}
}
}
}
// return 0;
getch();
}
OUTPUT:-
Enter the element in the muldimensional Array:-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Enter the element to find the address in the array:-5
Address of 5=0022FEF0
No comments:
Post a Comment
Note: only a member of this blog may post a comment.