C Programming-Structure and Union Questions and Answers

Practice Mode
Showing 10 of 29 questions
Q21
Identify the wrong statement.
  • A An array can have bit fields.
  • B A structure may contain bit fields.
  • C A structure has declaration and definition.
  • D a structure is a collection of data items of different data types
Answer: Option A
Q22
A bit field is
  • A a pointer variable in a structure
  • B one bit or a set of adjacent bits within a word
  • C a pointer variable in a union
  • D not used in C
Answer: Option B
Q23
A bit field can be of
  • A int
  • B float
  • C double
  • D all the above
Answer: Option A
Q24
Identify the wrong statement(s).
  • A Bit fields have addresses
  • B Bit fields can be read using scanf()
  • C Bit fields can be accessed using pointer
  • D all the above
Answer: Option D
Q25
Identify the correct statement(s).
  • A Bit fields are not arrays.
  • B Bit fields can not hold the values beyond their limits.
  • C Bit fields may be unnamed also.
  • D All the above.
Answer: Option D
Q26
Which is the valid declaration ?
  • A #typedef struct { int i;}in;
  • B typedef struct in {int i;};
  • C #typedef struct int {int i;};
  • D typedef struct {int i;}in;
Answer: Option D
Q27
The following statement is "The size of a struct is always equal to the sum of the sizes of its members."
  • A Valid
  • B Invalid
  • C Can't say
  • D Insufficient information
Answer: Option C
Q28
Stream oriented files are accessed through
  • A system calls
  • B library functions
  • C linker
  • D loader
Answer: Option B
Q29
C supports
  • A high level files
  • B low level files
  • C both options a and b
  • D executable files only
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test