Question
#include<stdio.h>
struct my_struct1
{
int arr[2][2];
};
typedef struct my_struct1 record;
struct my_struct2
{
record temp;
}list[2]={1,2,3,4,5,6,7,8};
void main()
{
int i,j,k;
for (i=1; i>=0; i--)
for (j=0; j=0; k--)
printf("%d",list[i].temp.arr[j][k]);
}
What will be output if you compile following c code ?
#include<stdio.h>
struct my_struct1
{
int arr[2][2];
};
typedef struct my_struct1 record;
struct my_struct2
{
record temp;
}list[2]={1,2,3,4,5,6,7,8};
void main()
{
int i,j,k;
for (i=1; i>=0; i--)
for (j=0; j=0; k--)
printf("%d",list[i].temp.arr[j][k]);
}
Answer: Option C
Was this answer helpful ?
This program illustrates the implementation of a nested structure i.e. structure inside another structure.
Was this answer helpful ?
Submit Solution