C Programming-Structure and Union Questions and Answers

Take Exam

C Programming Structure and Union questions with answers cover one of the most crucial topics in C. These programming questions and answers help learners differentiate between structures and unions, focusing on memory allocation, data sharing, and initialization techniques. Practicing C programming MCQ and programming interview questions with answers strengthens conceptual clarity required in technical interviews for companies like TCS, Infosys, and Accenture. Understanding how structures and unions store data enables developers to design efficient C programs, making this topic a vital part of C aptitude and placement preparation.

C Programming-Structure and Union

Showing 10 of 29 questions

21. Identify the wrong statement.

  • An array can have bit fields.
  • A structure may contain bit fields.
  • A structure has declaration and definition.
  • a structure is a collection of data items of different data types
Show Answer Report

22. A bit field is

  • a pointer variable in a structure
  • one bit or a set of adjacent bits within a word
  • a pointer variable in a union
  • not used in C
Show Answer Report

23. A bit field can be of

  • int
  • float
  • double
  • all the above
Show Answer Report

24. Identify the wrong statement(s).

  • Bit fields have addresses
  • Bit fields can be read using scanf()
  • Bit fields can be accessed using pointer
  • all the above
Show Answer Report

25. Identify the correct statement(s).

  • Bit fields are not arrays.
  • Bit fields can not hold the values beyond their limits.
  • Bit fields may be unnamed also.
  • All the above.
Show Answer Report

26. Which is the valid declaration ?

  • #typedef struct { int i;}in;
  • typedef struct in {int i;};
  • #typedef struct int {int i;};
  • typedef struct {int i;}in;
Show Answer Report

27. The following statement is "The size of a struct is always equal to the sum of the sizes of its members."

  • Valid
  • Invalid
  • Can't say
  • Insufficient information
Show Answer Report

28. Stream oriented files are accessed through

  • system calls
  • library functions
  • linker
  • loader
Show Answer Report

29. C supports

  • high level files
  • low level files
  • both options a and b
  • executable files only
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test