C Programming-Structure and Union Questions and Answers
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
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
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
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.
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;
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
28. Stream oriented files are accessed through
- system calls
- library functions
- linker
- loader
29. C supports
- high level files
- low level files
- both options a and b
- executable files only