Computer Science Class 12 Assignment - 1 Structures
Computer Science Class 12 Assignment - 1 Structures
Q1 Q2 Define structure with example. Name various components of a structure. Is tagname compulsory in structures ? What are the limitations on the structures whose tagname is not given ? Can prototype and definition of a structure be combined in a single statement? Declare a structure distance that contains length in m and cm . declare and initialize a. a distance b. array of 3 distances Can members of the structure initialized inside the structure definition ? Why ? What can be passed as argument - whole structure or an element of the structure ? Why it is preferable to pass structures by reference rather than by values? Give an example of nested structure . How are members of contained structure accessed by variable of container structure.? What are the similarities and differences between structure and an array ? How are they related? What is typedef ? What is advantage of using typedef ? What are the similarities and differences between typedef and a reference name? Give an example to show how typedef can be used to declare structure variables? Name few steps that are done in preprocessor phase ? Differentiate in # define and keyword const for declaring constants.
Q3 Q4
Q5 Q6 Q7 Q8
Q9
What is a macro ? Give few features of macro. Why missing brackets can sometimes lead to error in case of macros.?.