Student Details

Pre-Test

  1. What is a structure in C language.?

  2. A structure is a collection of elements that can be of same data type.
    A structure is a collection of elements that can be of different data type.
    Elements of a structure are called members.
    All the above

  3. What is the size of a C structure.?

  4. C structure is always 128 bytes.
    Size of C structure is the total bytes of all elements of structure.
    Size of C structure is the size of largest element.
    None of the above

  5. What is the output of C program with structures.?
    int main()
    {
    structure hotel
    {
    int items;
    char name[10];
    }a;
    strcpy(a.name, "TAJ");
    a.items=10;
    printf("%s", a.name);
    return 0;
    }
    }


  6. TAJ
    Empty string
    Compiler error
    None of the above

  7. Choose a correct statement about C structures.

  8. A structure can contain same structure type member.
    A structure size is limited by only physical memory of that PC.
    You can define an unlimited number of members inside a structure.
    All the above.

  9. What is the output of C program with structure arrays.?
    int main()
    {
    struct pens
    {
    int color;
    }p1[2];
    struct pens p2[3];
    p1[0].color=5;
    p1[1].color=9;
    printf("%d ",p1[0].color);
    printf("%d",p1[1].color);
    return 0;
    }

  10. 5 5
    5 9
    9 5
    Compiler error