Structure & Union Questions and Answers
Practice ModeShowing 10 of 95 questions
Q41
Find the output.
void main ( )
{
struct
{
char name [10];
int age;
}abc;
static struct abc={"raja", 15};
printf("%s %d, abc.name, abc. age);
}
Answer: Option D
Q42
Find the output
void main ( )
{
struct st
{
char x[10];
char *ptr;
};
struct st s={"puri","cuttrack"};
print ("%c%c",s.x[0], s.ptr[0]);
printf("%s %s", s.x.s.ptr);
}
Answer: Option A
Q43
Find the output
typedef struct {
int roll;
char name[15];
}student;
void main ( )
{
student s1, s2;
s2=s1={10, "Raja"};
printf("%d%s", s2.roll, s1.name);
}
Answer: Option C
Q44
Find out the odd one
Answer: Option A
Q45
Find the outpu
struct emp
{
int eno;
char name[10];
};
void main ( )
{
struct emp e1={121, "Rama"};
struct emp e2={122, "Dama'};
if(e1==e2)
printf("Same");
else
printf("Different");
}
Answer: Option C
Q46
Find the output
struct byte
{
int i:9;
int b:5;
int c;
char ch;
};
void main ( )
{
struct byte b;
printf("%d", sizeof(b));
}
Answer: Option A
Q47
Find the outpu
void main ( )
{
struct stu
{
int roll;
char name [10];
};
struct stu s={10, "Tuni"};
call (s);
}
call (struct stu s)
{
printf ("%d%s", s.roll, s.name);
}
Answer: Option B
Q48
Find the output
struct std
{
int code;
char place [10];
};
void fain (struct std);
void main ( )
{
struct std s={80,"bang");
fain (s);
printf("%d", s.code);
}
void fain (struct std s)
{
s.code++;
}
Answer: Option A
Q49
The memory allocated for union is internally done through
Answer: Option A
Q50
The memory allocated for union is internally done through
Answer: Option A