{"id":45306,"date":"2024-02-17T06:37:26","date_gmt":"2024-02-17T01:07:26","guid":{"rendered":"https:\/\/www.aplustopper.com\/?p=45306"},"modified":"2024-02-17T15:35:08","modified_gmt":"2024-02-17T10:05:08","slug":"plus-one-computer-science-notes-chapter-8","status":"publish","type":"post","link":"https:\/\/www.aplustopper.com\/plus-one-computer-science-notes-chapter-8\/","title":{"rendered":"Plus One Computer Science Notes Chapter 8 Arrays"},"content":{"rendered":"

Kerala Plus One Computer Science Notes Chapter 8 Arrays<\/h2>\n

Summary<\/span>
\nAn 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\u2019s index is 0, the second element’s index is 1, and so on.<\/p>\n

Declaring arrays:<\/span>
\nSuppose we want to find the sum of 100 numbers then we have to declare 100 variables to store the values. It is laborious work. Hence the need for array arises.
\nSyntax: data_type array_name[size];
\nTo store 100 numbers the array declaration is as follows
\nint n[100]; By this we store 100 numbers. The index of the first element is 0 and the index of last element is 99.<\/p>\n

Memory allocation for arrays:<\/span>
\nThe amount of memory requirement is directly related to its type and size,<\/p>\n