adplus-dvertising

Welcome to the Structures and Unions MCQs Page

Dive deep into the fascinating world of Structures and Unions with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Structures and Unions, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Structures and Unions, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Structures and Unions. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Structures and Unions. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Structures and Unions MCQs | Page 24 of 27

Explore more Topics under C Programming

Q231.
For the following function call which option is not possible?

func(&s.a;); //where s is a variable of type struct and a is the member of the struct.
Discuss
Answer: (a).Compiler can access entire structure from the function
Q232.
The correct syntax to access the member of the ith structure in the array of structures is?
Assuming: 
struct temp
{
  int b;
}s[50];
Discuss
Answer: (d).s[i].b;
Q233.
The number of distinct nodes the following struct declaration can point to is
struct node
{
   struct node *left;
   struct node *centre;
   struct node *right;
};
Discuss
Answer: (d).All of the above
Discuss
Answer: (d).All of the above
Discuss
Answer: (b).Size of C structure is the total bytes of all elements of structure.
Q236.
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;
}
Discuss
Answer: (c).Compiler error
Q237.
What is the output of C program?
int main()
{
    struct book
    {
        int pages;
        char name[10];
    }a;
    a.pages=10;
    strcpy(a.name,"Cbasics");
    printf("%s=%d", a.name,a.pages);
    return 0;
}
Discuss
Answer: (c).Cbasics=10
Discuss
Answer: (b).Structure members can not be initialized at the time of declaration
Discuss
Answer: (c).There is no use of defining an empty structure
Q240.
What is the output of C program?
int main()
{
    struct ship
    {
        int size;
        char color[10];
    }boat1, boat2;
    boat1.size=10;
    boat2 = boat1;
    printf("boat2=%d",boat2.size);
    return 0;
}
Discuss
Answer: (c).boat2=10

Suggested Topics

Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!