2.
What will be the output of the following C code?
#include <stdio.h>
struct p
{
    char *name;
    struct p *next;
};
struct p *ptrary[10];
int main()
{
    struct p p, q;
    p.name = "xyz";
    p.next = NULL;
    ptrary[0] = &p;
    strcpy(q.name, p.name);
    ptrary[1] = &q;
    printf("%s\n", ptrary[1]->name);
    return 0;
}

6.
What will be the output of the following C code?
#include <stdio.h>
struct student
{
    char *c;
};
void main()
{
    struct student n;
    struct student *s = &n;
    (*s).c = "hello";
    printf("%p\n%p\n", s, &n);
}

9.
What will be the output of the following C code?
#include <stdio.h>
union u
{
    struct
    {
        unsigned char x : 2;
        unsigned int y : 2;
    }p;
    int x;
};
int main()
{
    union u u.p = {2};
    printf("%d\n", u.p.x);
}

10.
Presence of loop in a linked list can be tested by . . . . . . . .

Read More Section(Structure and Union)

Each Section contains maximum 100 MCQs question on Structure and Union. To get more questions visit other sections.