Q.1.

size of union is size of the longest element in the union

Q.2.

The elements of union are always accessed using & operator

Q.3.

What will be the output of the program ?

#include<stdio.h>

int main()
{
    struct value
    {
        int bit1:        int bit3:        int bit4:    }bit={13};

    printf("%d, %d, %d\n", bit.bitbit.bitbit.bit4);
    return}
Q.4.

Bit fields CANNOT be used in union.

Q.5.

Is it necessary that the size of all elements in a union should be same?

Q.6.

Can we have an array of bit fields?

Q.7.

Will the following code work?

#include<stdio.h>
#include<malloc.h>

struct emp
{
    int len;
    char name[1];
};
int main()
{
    char newname[] = "Rahul";
    struct emp *p = (struct emp *) malloc(sizeof(struct emp) -1 +
                    strlen(newname)+1);

    p->len = strlen(newname);
    strcpy(p -> name, newname);
    printf("%d %s\n", p->len, p->name);
    return}
Q.8.

What will be the output of the program inbit platform (Turbo C under DOS) ?

#include<stdio.h>

int main()
{
    struct value
    {
        int bit1:        int bit3:        int bit4:    }bit;
    printf("%d\n", sizeof(bit));
    return}
Q.9.

one of elements of a structure can be a pointer to the same structure.

Q.10.

Will the following declaration work?

typedef struct s
{
    int a;
    float b;
}s;
Q.11.

A pointer union CANNOT be created

Q.12.

What will be the output of the program ?

#include<stdio.h>

int main()
{
    enum days {MON=-TUE, WED=THU, FRI, SAT};
    printf("%d, %d, %d, %d, %d, %d\n", MON, TUE, WED, THU, FRI, SAT);
    return
}
Q.13.

A structure can be nested inside another structure.