//Address of any element using row major order within 3d array
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,k,n;
int a[i][3][4];
printf("Enter the elements of array");
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 elements:");
scanf("%d",&n);
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
for(k=0;k<4;k++)
{
printf("%P",&n);
}
}
}
}
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,k,n;
int a[i][3][4];
printf("Enter the elements of array");
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 elements:");
scanf("%d",&n);
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
for(k=0;k<4;k++)
{
printf("%P",&n);
}
}
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.