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 21 of 27

Q201.
Consider the following declaration.  *(kd —> name + 2) can be used instead of

struct addr 
 {
 char city [10];
 char street [20]; 
 int pincode; 
 };
 struct 
 {
 char name[20];
 int sex; 
 struct addr locate;
 } criminal, *kd * &criminal;
Discuss
Answer: (c).Both (a) & (b)
Q202.
Assuming that bit-fields are accomodated from right to left and word size is 16-bits, consider the following declaration. Information about d will be in the
     static struct
                             {
                               unsigned a : 5;
                               unsigned b : 5;
                               unsigned c : 5;
                               unsigned d : 5;
                              } v =  (1, 2, 3, 4); 
Discuss
Answer: (b).second word
Q203.
Assuming that bit-fields are accomodated from right to left and word size is 16-bits, consider the following declaration. If the declaration unsigned c : 5; is replaced by unsigned : 6;
then,
      static struct {
                               unsigned a : 5;
                               unsigned b : 5;
                               unsigned c : 5;
                               unsigned d : 5;
                            } v =  (1, 2, 3, 4); 
Discuss
Answer: (d).none of the above
Discuss
Answer: (b).Only one member can be used at a time
Q205.
The size of the following union, where an int occupies 4 bytes of memory is
union demo
{
  float x;
  int y;
  char z[10];
};
Discuss
Answer: (c).10 byte
Q206.
Members of a union are accessed as________________.
Discuss
Answer: (c).Both a & b
Q207.
It is not possible to create an array of pointer to structures.
Discuss
Answer: (b).False
Q208.
Size of union is size of the longest element in the union.
Discuss
Answer: (a).Yes
Q209.
Which of the following share a similarity in syntax?

1. Union
2. Structure
3. Arrays
4. Pointers
Discuss
Answer: (b).1 and 2
Q210.
Which of the following accesses a variable in structure b?
Discuss
Answer: (b).b.var;

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!