| 1. |
Compare the aspects of arrays and structures. |
||||||||||||
|
Answer» Array-: An array is a collection of elements with same data type Or with the same name we can store many elements, the first or second or third etc can be distinguished by using the index(subscript). The first element’s index is 0, the second elements index is 1, and so on. To store 100 numbers the array declaration is as follows int n[100]; By this we store 100 numbers. The index of the first element is O and the index of last element is 99. Structure -: But a Structure is a group of different types of Ipgically related data referenced by a single name. Eg. The collection of details of a student that may contain various data with different data types. Eg. struct student { int adm_no; char name[40]; float weight; }; OR
|
|||||||||||||