Sail E0 Webinar
Question

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]);
}




Options:
A .  Compile Error
B .  Run time Error
C .  65872143
D .  56781243
Answer: Option C

This program illustrates the implementation of a nested structure i.e. structure inside another structure.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers