Mask-group

Practice Questions



  1. Ten floats are to be stored in memory. What would you prefer, an array or a structure?

Ans: An array, as all elements are of the same data type.

  1. Given the statement, maruti.engine.bolts = 25 ; 

Which of the following is True?

  1. structure bolts is nested within structure engine 

  2. structure engine is nested within structure maruti

  3. structure maruti is nested within structure engine

  4. structure maruti is nested within structure bolts 

Ans: a. structure bolts is nested within structure engine 

  1. State True or False

    1. All structure elements are stored in contiguous memory locations. 

Ans: True

  1. An array should be used to store dissimilar elements, and a structure to store similar elements. 

Ans: False

  1. In an array of structures, not only are all structures stored in contiguous memory locations, but the elements of individual structures are also stored in contiguous locations. 

Ans: True