True / False Questions

Question 1 :

A union cannot be nested in a structure


A). True
B). False
Answer : Option B

Question 2 :

Nested unions are allowed


A). True
B). False
Answer : Option A

Question 3 :

Bit fields CANNOT be used in union.


A). True
B). False
Answer : Option B

Explanation :

The following is the example program to explain "using bit fields inside an union".

#include < stdio.h >

union Point
{
  unsigned int x:4;
  unsigned int y:4;
  int res;
};

int main()
{
   union  Point pt;

   pt.x = 2;
   pt.y = 3;
   pt.res = pt.y;

   printf("\n The value of res = %d" , pt.res);

   return 0;
}
// Output: The value of res = 3


Question 4 :

one of elements of a structure can be a pointer to the same structure.


A). True
B). False
Answer : Option A

Question 5 :

A structure can be nested inside another structure.


A). True
B). False
Answer : Option A

Question 6 :

Which of the following statement is True?


A). User has to explicitly define the numeric value of enumerations
B). User has a control over the size of enumeration variables.
C). Enumeration can have an effect local to the block, if desired
D). Enumerations have a global effect throughout the file.
Answer : Option C

Question 7 :

The '.' operator can be used access structure elements using a structure variable.


A). True
B). False
Answer : Option A

Question 8 :

Union elements can be of different sizes.


A). True
B). False
Answer : Option A

Question 9 :

A structure can contain similar or dissimilar elements


A). True
B). False
Answer : Option A

Question 10 :

The '->' operator can be used to access structures elements using a pointer to a structure variable only


A). True
B). False
Answer : Option A

Question 11 :

It is not possible to create an array of pointer to structures.


A). True
B). False
Answer : Option B